<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE ExistentialQuantification #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE GeneralizedNewtypeDeriving #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE FlexibleInstances #-}</span><span>
</span><span id="line-6"></span><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE UndecidableInstances #-}</span><span>
</span><span id="line-8"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span class="hs-cpp">

#if defined(__GLASGOW_HASKELL__) &amp;&amp; __GLASGOW_HASKELL__ &gt;= 702
</span><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">
#ifndef MIN_VERSION_transformers
</span><span class="hs-cpp">#define MIN_VERSION_transformers(x,y,z) 1
</span><span class="hs-cpp">#endif
</span><span class="hs-cpp">
#ifndef MIN_VERSION_mtl
</span><span class="hs-cpp">#define MIN_VERSION_mtl(x,y,z) 1
</span><span class="hs-cpp">#endif
</span><span>
</span><span id="line-22"></span><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-deprecations #-}</span><span>
</span><span id="line-23"></span><span class="hs-comment">--------------------------------------------------------------------</span><span>
</span><span id="line-24"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-25"></span><span class="hs-comment">-- Copyright   :  (C) Edward Kmett 2013-2015, (c) Google Inc. 2012</span><span>
</span><span id="line-26"></span><span class="hs-comment">-- License     :  BSD-style (see the file LICENSE)</span><span>
</span><span id="line-27"></span><span class="hs-comment">-- Maintainer  :  Edward Kmett &lt;ekmett@gmail.com&gt;</span><span>
</span><span id="line-28"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-29"></span><span class="hs-comment">-- Portability :  non-portable</span><span>
</span><span id="line-30"></span><span class="hs-comment">--</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- This module supports monads that can throw extensible exceptions. The</span><span>
</span><span id="line-32"></span><span class="hs-comment">-- exceptions are the very same from &quot;Control.Exception&quot;, and the operations</span><span>
</span><span id="line-33"></span><span class="hs-comment">-- offered very similar, but here they are not limited to 'IO'.</span><span>
</span><span id="line-34"></span><span class="hs-comment">--</span><span>
</span><span id="line-35"></span><span class="hs-comment">-- This code is in the style of both transformers and mtl, and is compatible</span><span>
</span><span id="line-36"></span><span class="hs-comment">-- with them, though doesn't mimic the module structure or offer the complete</span><span>
</span><span id="line-37"></span><span class="hs-comment">-- range of features in those packages.</span><span>
</span><span id="line-38"></span><span class="hs-comment">--</span><span>
</span><span id="line-39"></span><span class="hs-comment">-- This is very similar to 'ErrorT' and 'MonadError', but based on features of</span><span>
</span><span id="line-40"></span><span class="hs-comment">-- &quot;Control.Exception&quot;. In particular, it handles the complex case of</span><span>
</span><span id="line-41"></span><span class="hs-comment">-- asynchronous exceptions by including 'mask' in the typeclass. Note that the</span><span>
</span><span id="line-42"></span><span class="hs-comment">-- extensible exceptions feature relies on the RankNTypes language extension.</span><span>
</span><span id="line-43"></span><span class="hs-comment">--------------------------------------------------------------------</span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Control.Monad.Catch</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-46"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Typeclass</span></span><span>
</span><span id="line-47"></span><span>    </span><span class="annot"><span class="hs-comment">-- $mtl</span></span><span>
</span><span id="line-48"></span><span>    </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier">MonadThrow</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-49"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier">MonadCatch</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier">MonadMask</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-51"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCase"><span class="hs-identifier">ExitCase</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Utilities</span></span><span>
</span><span id="line-54"></span><span>    </span><span class="annot"><span class="hs-comment">-- $utilities</span></span><span>
</span><span id="line-55"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#mask_"><span class="hs-identifier">mask_</span></a></span><span>
</span><span id="line-56"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#uninterruptibleMask_"><span class="hs-identifier">uninterruptibleMask_</span></a></span><span>
</span><span id="line-57"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#catchAll"><span class="hs-identifier">catchAll</span></a></span><span>
</span><span id="line-58"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#catchIOError"><span class="hs-identifier">catchIOError</span></a></span><span>
</span><span id="line-59"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#catchJust"><span class="hs-identifier">catchJust</span></a></span><span>
</span><span id="line-60"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#catchIf"><span class="hs-identifier">catchIf</span></a></span><span>
</span><span id="line-61"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#Handler"><span class="hs-identifier">Handler</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#catches"><span class="hs-identifier">catches</span></a></span><span>
</span><span id="line-62"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#handle"><span class="hs-identifier">handle</span></a></span><span>
</span><span id="line-63"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#handleAll"><span class="hs-identifier">handleAll</span></a></span><span>
</span><span id="line-64"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#handleIOError"><span class="hs-identifier">handleIOError</span></a></span><span>
</span><span id="line-65"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#handleJust"><span class="hs-identifier">handleJust</span></a></span><span>
</span><span id="line-66"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#handleIf"><span class="hs-identifier">handleIf</span></a></span><span>
</span><span id="line-67"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#try"><span class="hs-identifier">try</span></a></span><span>
</span><span id="line-68"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#tryJust"><span class="hs-identifier">tryJust</span></a></span><span>
</span><span id="line-69"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#onException"><span class="hs-identifier">onException</span></a></span><span>
</span><span id="line-70"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#onError"><span class="hs-identifier">onError</span></a></span><span>
</span><span id="line-71"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#bracket"><span class="hs-identifier">bracket</span></a></span><span>
</span><span id="line-72"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#bracket_"><span class="hs-identifier">bracket_</span></a></span><span>
</span><span id="line-73"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#finally"><span class="hs-identifier">finally</span></a></span><span>
</span><span id="line-74"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#bracketOnError"><span class="hs-identifier">bracketOnError</span></a></span><span>
</span><span id="line-75"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Re-exports from Control.Exception</span></span><span>
</span><span id="line-76"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier">Exception</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier">SomeException</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Exception.html#"><span class="hs-identifier">Control.Exception</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier">Exception</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier">SomeException</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-81"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Control.Exception.html#"><span class="hs-identifier">Control.Exception</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">ControlException</span></span><span>
</span><span id="line-82"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../stm/src/Control.Monad.STM.html#"><span class="hs-identifier">Control.Monad.STM</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">STM</span></span><span>
</span><span id="line-83"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#"><span class="hs-identifier">Control.Monad.Trans.RWS.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LazyRWS</span></span><span>
</span><span id="line-84"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#"><span class="hs-identifier">Control.Monad.Trans.RWS.Strict</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">StrictRWS</span></span><span>
</span><span id="line-85"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#"><span class="hs-identifier">Control.Monad.Trans.State.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LazyS</span></span><span>
</span><span id="line-86"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#"><span class="hs-identifier">Control.Monad.Trans.State.Strict</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">StrictS</span></span><span>
</span><span id="line-87"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#"><span class="hs-identifier">Control.Monad.Trans.Writer.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LazyW</span></span><span>
</span><span id="line-88"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#"><span class="hs-identifier">Control.Monad.Trans.Writer.Strict</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">StrictW</span></span><span>
</span><span id="line-89"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.ST.html#"><span class="hs-identifier">Control.Monad.ST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier">ST</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-90"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../stm/src/Control.Monad.STM.html#"><span class="hs-identifier">Control.Monad.STM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Conc.Sync.html#STM"><span class="hs-identifier">STM</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-91"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.List.html#"><span class="hs-identifier">Control.Monad.Trans.List</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.List.html#ListT"><span class="hs-identifier">ListT</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.List.html#runListT"><span class="hs-identifier">runListT</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-92"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#"><span class="hs-identifier">Control.Monad.Trans.Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier">MaybeT</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier">runMaybeT</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-93"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#"><span class="hs-identifier">Control.Monad.Trans.Error</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier">ErrorT</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#Error"><span class="hs-identifier">Error</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier">runErrorT</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-94"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#"><span class="hs-identifier">Control.Monad.Trans.Except</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier">ExceptT</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#runExceptT"><span class="hs-identifier">runExceptT</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-95"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Cont.html#"><span class="hs-identifier">Control.Monad.Trans.Cont</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Cont.html#ContT"><span class="hs-identifier">ContT</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-96"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#"><span class="hs-identifier">Control.Monad.Trans.Identity</span></a></span><span>
</span><span id="line-97"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../mtl/src/Control.Monad.Reader.html#"><span class="hs-identifier">Control.Monad.Reader</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Reader</span></span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../template-haskell/src/Language.Haskell.TH.Syntax.html#"><span class="hs-identifier">Language.Haskell.TH.Syntax</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../template-haskell/src/Language.Haskell.TH.Syntax.html#Q"><span class="hs-identifier">Q</span></a></span><span class="hs-special">)</span><span class="hs-cpp">

#if MIN_VERSION_base(4,4,0)
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.ST.Unsafe.html#"><span class="hs-identifier">Control.Monad.ST.Unsafe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.html#unsafeIOToST"><span class="hs-identifier">unsafeIOToST</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#else
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Control.Monad.ST</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">unsafeIOToST</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &lt; 706
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Prelude</span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">catch</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">foldr</span><span class="hs-special">)</span><span>
</span><span id="line-109"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data.Foldable</span><span>
</span><span id="line-110"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data.Monoid</span><span class="hs-cpp">
#elif __GLASGOW_HASKELL__ &lt; 710
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Prelude</span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">foldr</span><span class="hs-special">)</span><span>
</span><span id="line-113"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data.Foldable</span><span>
</span><span id="line-114"></span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data.Monoid</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &lt; 710
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Control.Applicative</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-121"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-122"></span><span class="hs-comment">-- $mtl</span><span>
</span><span id="line-123"></span><span class="hs-comment">-- The mtl style typeclass</span><span>
</span><span id="line-124"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-125"></span><span>
</span><span id="line-126"></span><span class="hs-comment">-- | A class for monads in which exceptions may be thrown.</span><span>
</span><span id="line-127"></span><span class="hs-comment">--</span><span>
</span><span id="line-128"></span><span class="hs-comment">-- Instances should obey the following law:</span><span>
</span><span id="line-129"></span><span class="hs-comment">--</span><span>
</span><span id="line-130"></span><span class="hs-comment">-- &gt; throwM e &gt;&gt; x = throwM e</span><span>
</span><span id="line-131"></span><span class="hs-comment">--</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- In other words, throwing an exception short-circuits the rest of the monadic</span><span>
</span><span id="line-133"></span><span class="hs-comment">-- computation.</span><span>
</span><span id="line-134"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055212"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="MonadThrow"><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-var">MonadThrow</span></a></span></span><span> </span><span id="local-6989586621679055212"><span class="annot"><a href="#local-6989586621679055212"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-135"></span><span>  </span><span class="hs-comment">-- | Throw an exception. Note that this throws when this action is run in</span><span>
</span><span id="line-136"></span><span>  </span><span class="hs-comment">-- the monad @m@, not when it is applied. It is a generalization of</span><span>
</span><span id="line-137"></span><span>  </span><span class="hs-comment">-- &quot;Control.Exception&quot;'s 'ControlException.throwIO'.</span><span>
</span><span id="line-138"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-139"></span><span>  </span><span class="hs-comment">-- Should satisfy the law:</span><span>
</span><span id="line-140"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-141"></span><span>  </span><span class="hs-comment">-- &gt; throwM e &gt;&gt; f = throwM e</span><span>
</span><span id="line-142"></span><span>  </span><span id="local-6989586621679055200"><span id="local-6989586621679055202"><span id="throwM"><span class="annot"><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-type">throwM</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055202"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055202"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055212"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055200"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="hs-comment">-- | A class for monads which allow exceptions to be caught, in particular</span><span>
</span><span id="line-145"></span><span class="hs-comment">-- exceptions which were thrown by 'throwM'.</span><span>
</span><span id="line-146"></span><span class="hs-comment">--</span><span>
</span><span id="line-147"></span><span class="hs-comment">-- Instances should obey the following law:</span><span>
</span><span id="line-148"></span><span class="hs-comment">--</span><span>
</span><span id="line-149"></span><span class="hs-comment">-- &gt; catch (throwM e) f = f e</span><span>
</span><span id="line-150"></span><span class="hs-comment">--</span><span>
</span><span id="line-151"></span><span class="hs-comment">-- Note that the ability to catch an exception does /not/ guarantee that we can</span><span>
</span><span id="line-152"></span><span class="hs-comment">-- deal with all possible exit points from a computation. Some monads, such as</span><span>
</span><span id="line-153"></span><span class="hs-comment">-- continuation-based stacks, allow for more than just a success/failure</span><span>
</span><span id="line-154"></span><span class="hs-comment">-- strategy, and therefore @catch@ /cannot/ be used by those monads to properly</span><span>
</span><span id="line-155"></span><span class="hs-comment">-- implement a function such as @finally@. For more information, see</span><span>
</span><span id="line-156"></span><span class="hs-comment">-- 'MonadMask'.</span><span>
</span><span id="line-157"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055210"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="MonadCatch"><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-var">MonadCatch</span></a></span></span><span> </span><span id="local-6989586621679055210"><span class="annot"><a href="#local-6989586621679055210"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-158"></span><span>  </span><span class="hs-comment">-- | Provide a handler for exceptions thrown during execution of the first</span><span>
</span><span id="line-159"></span><span>  </span><span class="hs-comment">-- action. Note that type of the type of the argument to the handler will</span><span>
</span><span id="line-160"></span><span>  </span><span class="hs-comment">-- constrain which exceptions are caught. See &quot;Control.Exception&quot;'s</span><span>
</span><span id="line-161"></span><span>  </span><span class="hs-comment">-- 'ControlException.catch'.</span><span>
</span><span id="line-162"></span><span>  </span><span id="local-6989586621679055183"><span id="local-6989586621679055184"><span id="catch"><span class="annot"><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-type">catch</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055184"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055210"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055183"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055184"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055210"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055183"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055210"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055183"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span class="hs-comment">-- | A class for monads which provide for the ability to account for</span><span>
</span><span id="line-165"></span><span class="hs-comment">-- all possible exit points from a computation, and to mask</span><span>
</span><span id="line-166"></span><span class="hs-comment">-- asynchronous exceptions. Continuation-based monads are invalid</span><span>
</span><span id="line-167"></span><span class="hs-comment">-- instances of this class.</span><span>
</span><span id="line-168"></span><span class="hs-comment">--</span><span>
</span><span id="line-169"></span><span class="hs-comment">-- Instances should ensure that, in the following code:</span><span>
</span><span id="line-170"></span><span class="hs-comment">--</span><span>
</span><span id="line-171"></span><span class="hs-comment">-- &gt; fg = f `finally` g</span><span>
</span><span id="line-172"></span><span class="hs-comment">--</span><span>
</span><span id="line-173"></span><span class="hs-comment">-- The action @g@ is called regardless of what occurs within @f@, including</span><span>
</span><span id="line-174"></span><span class="hs-comment">-- async exceptions. Some monads allow @f@ to abort the computation via other</span><span>
</span><span id="line-175"></span><span class="hs-comment">-- effects than throwing an exception. For simplicity, we will consider aborting</span><span>
</span><span id="line-176"></span><span class="hs-comment">-- and throwing an exception to be two forms of &quot;throwing an error&quot;.</span><span>
</span><span id="line-177"></span><span class="hs-comment">--</span><span>
</span><span id="line-178"></span><span class="hs-comment">-- If @f@ and @g@ both throw an error, the error thrown by @fg@ depends on which</span><span>
</span><span id="line-179"></span><span class="hs-comment">-- errors we're talking about. In a monad transformer stack, the deeper layers</span><span>
</span><span id="line-180"></span><span class="hs-comment">-- override the effects of the inner layers; for example, @ExceptT e1 (Except</span><span>
</span><span id="line-181"></span><span class="hs-comment">-- e2) a@ represents a value of type @Either e2 (Either e1 a)@, so throwing both</span><span>
</span><span id="line-182"></span><span class="hs-comment">-- an @e1@ and an @e2@ will result in @Left e2@. If @f@ and @g@ both throw an</span><span>
</span><span id="line-183"></span><span class="hs-comment">-- error from the same layer, instances should ensure that the error from @g@</span><span>
</span><span id="line-184"></span><span class="hs-comment">-- wins.</span><span>
</span><span id="line-185"></span><span class="hs-comment">--</span><span>
</span><span id="line-186"></span><span class="hs-comment">-- Effects other than throwing an error are also overriden by the deeper layers.</span><span>
</span><span id="line-187"></span><span class="hs-comment">-- For example, @StateT s Maybe a@ represents a value of type @s -&gt; Maybe (a,</span><span>
</span><span id="line-188"></span><span class="hs-comment">-- s)@, so if an error thrown from @f@ causes this function to return @Nothing@,</span><span>
</span><span id="line-189"></span><span class="hs-comment">-- any changes to the state which @f@ also performed will be erased. As a</span><span>
</span><span id="line-190"></span><span class="hs-comment">-- result, @g@ will see the state as it was before @f@. Once @g@ completes,</span><span>
</span><span id="line-191"></span><span class="hs-comment">-- @f@'s error will be rethrown, so @g@' state changes will be erased as well.</span><span>
</span><span id="line-192"></span><span class="hs-comment">-- This is the normal interaction between effects in a monad transformer stack.</span><span>
</span><span id="line-193"></span><span class="hs-comment">--</span><span>
</span><span id="line-194"></span><span class="hs-comment">-- By contrast, &lt;https://hackage.haskell.org/package/lifted-base lifted-base&gt;'s</span><span>
</span><span id="line-195"></span><span class="hs-comment">-- version of 'finally' always discards all of @g@'s non-IO effects, and @g@</span><span>
</span><span id="line-196"></span><span class="hs-comment">-- never sees any of @f@'s non-IO effects, regardless of the layer ordering and</span><span>
</span><span id="line-197"></span><span class="hs-comment">-- regardless of whether @f@ throws an error. This is not the result of</span><span>
</span><span id="line-198"></span><span class="hs-comment">-- interacting effects, but a consequence of @MonadBaseControl@'s approach.</span><span>
</span><span id="line-199"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="MonadMask"><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-var">MonadMask</span></a></span></span><span> </span><span id="local-6989586621679055208"><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-200"></span><span>  </span><span class="hs-comment">-- | Runs an action with asynchronous exceptions disabled. The action is</span><span>
</span><span id="line-201"></span><span>  </span><span class="hs-comment">-- provided a method for restoring the async. environment to what it was</span><span>
</span><span id="line-202"></span><span>  </span><span class="hs-comment">-- at the 'mask' call. See &quot;Control.Exception&quot;'s 'ControlException.mask'.</span><span>
</span><span id="line-203"></span><span>  </span><span id="local-6989586621679055179"><span id="mask"><span class="annot"><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-type">mask</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679055180"><span class="annot"><a href="#local-6989586621679055180"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055180"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055180"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055179"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055179"><span class="hs-identifier hs-type">b</span></a></span></span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span>  </span><span class="hs-comment">-- | Like 'mask', but the masked computation is not interruptible (see</span><span>
</span><span id="line-206"></span><span>  </span><span class="hs-comment">-- &quot;Control.Exception&quot;'s 'ControlException.uninterruptibleMask'. WARNING:</span><span>
</span><span id="line-207"></span><span>  </span><span class="hs-comment">-- Only use if you need to mask exceptions around an interruptible operation</span><span>
</span><span id="line-208"></span><span>  </span><span class="hs-comment">-- AND you can guarantee the interruptible operation will only block for a</span><span>
</span><span id="line-209"></span><span>  </span><span class="hs-comment">-- short period of time. Otherwise you render the program/thread unresponsive</span><span>
</span><span id="line-210"></span><span>  </span><span class="hs-comment">-- and/or unkillable.</span><span>
</span><span id="line-211"></span><span>  </span><span id="local-6989586621679054413"><span id="uninterruptibleMask"><span class="annot"><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-type">uninterruptibleMask</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679054586"><span class="annot"><a href="#local-6989586621679054586"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054586"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054586"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054413"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054413"><span class="hs-identifier hs-type">b</span></a></span></span><span>
</span><span id="line-212"></span><span>
</span><span id="line-213"></span><span>  </span><span class="hs-comment">-- | A generalized version of 'bracket' which uses 'ExitCase' to distinguish</span><span>
</span><span id="line-214"></span><span>  </span><span class="hs-comment">-- the different exit cases, and returns the values of both the 'use' and</span><span>
</span><span id="line-215"></span><span>  </span><span class="hs-comment">-- 'release' actions. In practice, this extra information is rarely needed,</span><span>
</span><span id="line-216"></span><span>  </span><span class="hs-comment">-- so it is often more convenient to use one of the simpler functions which</span><span>
</span><span id="line-217"></span><span>  </span><span class="hs-comment">-- are defined in terms of this one, such as 'bracket', 'finally', 'onError',</span><span>
</span><span id="line-218"></span><span>  </span><span class="hs-comment">-- and 'bracketOnError'.</span><span>
</span><span id="line-219"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-220"></span><span>  </span><span class="hs-comment">-- This function exists because in order to thread their effects through the</span><span>
</span><span id="line-221"></span><span>  </span><span class="hs-comment">-- execution of 'bracket', monad transformers need values to be threaded from</span><span>
</span><span id="line-222"></span><span>  </span><span class="hs-comment">-- 'use' to 'release' and from 'release' to the output value.</span><span>
</span><span id="line-223"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-224"></span><span>  </span><span class="hs-comment">-- /NOTE/ This method was added in version 0.9.0 of this</span><span>
</span><span id="line-225"></span><span>  </span><span class="hs-comment">-- library. Previously, implementation of functions like 'bracket'</span><span>
</span><span id="line-226"></span><span>  </span><span class="hs-comment">-- and 'finally' in this module were based on the 'mask' and</span><span>
</span><span id="line-227"></span><span>  </span><span class="hs-comment">-- 'uninterruptibleMask' functions only, disallowing some classes of</span><span>
</span><span id="line-228"></span><span>  </span><span class="hs-comment">-- tranformers from having @MonadMask@ instances (notably</span><span>
</span><span id="line-229"></span><span>  </span><span class="hs-comment">-- multi-exit-point transformers like 'ExceptT'). If you are a</span><span>
</span><span id="line-230"></span><span>  </span><span class="hs-comment">-- library author, you'll now need to provide an implementation for</span><span>
</span><span id="line-231"></span><span>  </span><span class="hs-comment">-- this method. The @StateT@ implementation demonstrates most of the</span><span>
</span><span id="line-232"></span><span>  </span><span class="hs-comment">-- subtleties:</span><span>
</span><span id="line-233"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-234"></span><span>  </span><span class="hs-comment">-- @</span><span>
</span><span id="line-235"></span><span>  </span><span class="hs-comment">-- generalBracket acquire release use = StateT $ \s0 -&gt; do</span><span>
</span><span id="line-236"></span><span>  </span><span class="hs-comment">--   ((b, _s2), (c, s3)) &lt;- generalBracket</span><span>
</span><span id="line-237"></span><span>  </span><span class="hs-comment">--     (runStateT acquire s0)</span><span>
</span><span id="line-238"></span><span>  </span><span class="hs-comment">--     (\(resource, s1) exitCase -&gt; case exitCase of</span><span>
</span><span id="line-239"></span><span>  </span><span class="hs-comment">--       ExitCaseSuccess (b, s2) -&gt; runStateT (release resource (ExitCaseSuccess b)) s2</span><span>
</span><span id="line-240"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-241"></span><span>  </span><span class="hs-comment">--       -- In the two other cases, the base monad overrides @use@'s state</span><span>
</span><span id="line-242"></span><span>  </span><span class="hs-comment">--       -- changes and the state reverts to @s1@.</span><span>
</span><span id="line-243"></span><span>  </span><span class="hs-comment">--       ExitCaseException e     -&gt; runStateT (release resource (ExitCaseException e)) s1</span><span>
</span><span id="line-244"></span><span>  </span><span class="hs-comment">--       ExitCaseAbort           -&gt; runStateT (release resource ExitCaseAbort) s1</span><span>
</span><span id="line-245"></span><span>  </span><span class="hs-comment">--     )</span><span>
</span><span id="line-246"></span><span>  </span><span class="hs-comment">--     (\(resource, s1) -&gt; runStateT (use resource) s1)</span><span>
</span><span id="line-247"></span><span>  </span><span class="hs-comment">--   return ((b, c), s3)</span><span>
</span><span id="line-248"></span><span>  </span><span class="hs-comment">-- @</span><span>
</span><span id="line-249"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-250"></span><span>  </span><span class="hs-comment">-- The @StateT s m@ implementation of @generalBracket@ delegates to the @m@</span><span>
</span><span id="line-251"></span><span>  </span><span class="hs-comment">-- implementation of @generalBracket@. The @acquire@, @use@, and @release@</span><span>
</span><span id="line-252"></span><span>  </span><span class="hs-comment">-- arguments given to @StateT@'s implementation produce actions of type</span><span>
</span><span id="line-253"></span><span>  </span><span class="hs-comment">-- @StateT s m a@, @StateT s m b@, and @StateT s m c@. In order to run those</span><span>
</span><span id="line-254"></span><span>  </span><span class="hs-comment">-- actions in the base monad, we need to call @runStateT@, from which we</span><span>
</span><span id="line-255"></span><span>  </span><span class="hs-comment">-- obtain actions of type @m (a, s)@, @m (b, s)@, and @m (c, s)@. Since each</span><span>
</span><span id="line-256"></span><span>  </span><span class="hs-comment">-- action produces the next state, it is important to feed the state produced</span><span>
</span><span id="line-257"></span><span>  </span><span class="hs-comment">-- by the previous action to the next action.</span><span>
</span><span id="line-258"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-259"></span><span>  </span><span class="hs-comment">-- In the 'ExitCaseSuccess' case, the state starts at @s0@, flows through</span><span>
</span><span id="line-260"></span><span>  </span><span class="hs-comment">-- @acquire@ to become @s1@, flows through @use@ to become @s2@, and finally</span><span>
</span><span id="line-261"></span><span>  </span><span class="hs-comment">-- flows through @release@ to become @s3@. In the other two cases, @release@</span><span>
</span><span id="line-262"></span><span>  </span><span class="hs-comment">-- does not receive the value @s2@, so its action cannot see the state changes</span><span>
</span><span id="line-263"></span><span>  </span><span class="hs-comment">-- performed by @use@. This is fine, because in those two cases, an error was</span><span>
</span><span id="line-264"></span><span>  </span><span class="hs-comment">-- thrown in the base monad, so as per the usual interaction between effects</span><span>
</span><span id="line-265"></span><span>  </span><span class="hs-comment">-- in a monad transformer stack, those state changes get reverted. So we start</span><span>
</span><span id="line-266"></span><span>  </span><span class="hs-comment">-- from @s1@ instead.</span><span>
</span><span id="line-267"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-268"></span><span>  </span><span class="hs-comment">-- Finally, the @m@ implementation of @generalBracket@ returns the pairs</span><span>
</span><span id="line-269"></span><span>  </span><span class="hs-comment">-- @(b, s)@ and @(c, s)@. For monad transformers other than @StateT@, this</span><span>
</span><span id="line-270"></span><span>  </span><span class="hs-comment">-- will be some other type representing the effects and values performed and</span><span>
</span><span id="line-271"></span><span>  </span><span class="hs-comment">-- returned by the @use@ and @release@ actions. The effect part of the @use@</span><span>
</span><span id="line-272"></span><span>  </span><span class="hs-comment">-- result, in this case @_s2@, usually needs to be discarded, since those</span><span>
</span><span id="line-273"></span><span>  </span><span class="hs-comment">-- effects have already been incorporated in the @release@ action.</span><span>
</span><span id="line-274"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-275"></span><span>  </span><span class="hs-comment">-- The only effect which is intentionally not incorporated in the @release@</span><span>
</span><span id="line-276"></span><span>  </span><span class="hs-comment">-- action is the effect of throwing an error. In that case, the error must be</span><span>
</span><span id="line-277"></span><span>  </span><span class="hs-comment">-- re-thrown. One subtlety which is easy to miss is that in the case in which</span><span>
</span><span id="line-278"></span><span>  </span><span class="hs-comment">-- @use@ and @release@ both throw an error, the error from @release@ should</span><span>
</span><span id="line-279"></span><span>  </span><span class="hs-comment">-- take priority. Here is an implementation for @ExceptT@ which demonstrates</span><span>
</span><span id="line-280"></span><span>  </span><span class="hs-comment">-- how to do this.</span><span>
</span><span id="line-281"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-282"></span><span>  </span><span class="hs-comment">-- @</span><span>
</span><span id="line-283"></span><span>  </span><span class="hs-comment">-- generalBracket acquire release use = ExceptT $ do</span><span>
</span><span id="line-284"></span><span>  </span><span class="hs-comment">--   (eb, ec) &lt;- generalBracket</span><span>
</span><span id="line-285"></span><span>  </span><span class="hs-comment">--     (runExceptT acquire)</span><span>
</span><span id="line-286"></span><span>  </span><span class="hs-comment">--     (\eresource exitCase -&gt; case eresource of</span><span>
</span><span id="line-287"></span><span>  </span><span class="hs-comment">--       Left e -&gt; return (Left e) -- nothing to release, acquire didn't succeed</span><span>
</span><span id="line-288"></span><span>  </span><span class="hs-comment">--       Right resource -&gt; case exitCase of</span><span>
</span><span id="line-289"></span><span>  </span><span class="hs-comment">--         ExitCaseSuccess (Right b) -&gt; runExceptT (release resource (ExitCaseSuccess b))</span><span>
</span><span id="line-290"></span><span>  </span><span class="hs-comment">--         ExitCaseException e       -&gt; runExceptT (release resource (ExitCaseException e))</span><span>
</span><span id="line-291"></span><span>  </span><span class="hs-comment">--         _                         -&gt; runExceptT (release resource ExitCaseAbort))</span><span>
</span><span id="line-292"></span><span>  </span><span class="hs-comment">--     (either (return . Left) (runExceptT . use))</span><span>
</span><span id="line-293"></span><span>  </span><span class="hs-comment">--   return $ do</span><span>
</span><span id="line-294"></span><span>  </span><span class="hs-comment">--     -- The order in which we perform those two 'Either' effects determines</span><span>
</span><span id="line-295"></span><span>  </span><span class="hs-comment">--     -- which error will win if they are both 'Left's. We want the error from</span><span>
</span><span id="line-296"></span><span>  </span><span class="hs-comment">--     -- 'release' to win.</span><span>
</span><span id="line-297"></span><span>  </span><span class="hs-comment">--     c &lt;- ec</span><span>
</span><span id="line-298"></span><span>  </span><span class="hs-comment">--     b &lt;- eb</span><span>
</span><span id="line-299"></span><span>  </span><span class="hs-comment">--     return (b, c)</span><span>
</span><span id="line-300"></span><span>  </span><span class="hs-comment">-- @</span><span>
</span><span id="line-301"></span><span>  </span><span class="hs-comment">--</span><span>
</span><span id="line-302"></span><span>  </span><span class="hs-comment">-- @since 0.9.0</span><span>
</span><span id="line-303"></span><span>  </span><span id="local-6989586621679055176"><span id="local-6989586621679055177"><span id="local-6989586621679055178"><span id="generalBracket"><span class="annot"><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-type">generalBracket</span></a></span></span><span>
</span><span id="line-304"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055178"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-305"></span><span>    </span><span class="hs-comment">-- ^ acquire some resource</span><span>
</span><span id="line-306"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055178"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCase"><span class="hs-identifier hs-type">ExitCase</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055177"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055176"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-307"></span><span>    </span><span class="hs-comment">-- ^ release the resource, observing the outcome of the inner action</span><span>
</span><span id="line-308"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055178"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055177"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-309"></span><span>    </span><span class="hs-comment">-- ^ inner action to perform with the resource</span><span>
</span><span id="line-310"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055208"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055177"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679055176"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-311"></span><span>
</span><span id="line-312"></span><span class="hs-comment">-- | A 'MonadMask' computation may either succeed with a value, abort with an</span><span>
</span><span id="line-313"></span><span class="hs-comment">-- exception, or abort for some other reason. For example, in @ExceptT e IO@</span><span>
</span><span id="line-314"></span><span class="hs-comment">-- you can use 'throwM' to abort with an exception ('ExitCaseException') or</span><span>
</span><span id="line-315"></span><span class="hs-comment">-- 'Control.Monad.Trans.Except.throwE' to abort with a value of type 'e'</span><span>
</span><span id="line-316"></span><span class="hs-comment">-- ('ExitCaseAbort').</span><span>
</span><span id="line-317"></span><span class="hs-keyword">data</span><span> </span><span id="ExitCase"><span class="annot"><a href="Control.Monad.Catch.html#ExitCase"><span class="hs-identifier hs-var">ExitCase</span></a></span></span><span> </span><span id="local-6989586621679055203"><span class="annot"><a href="#local-6989586621679055203"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-318"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="ExitCaseSuccess"><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-var">ExitCaseSuccess</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679055203"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-319"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ExitCaseException"><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-var">ExitCaseException</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span>
</span><span id="line-320"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="ExitCaseAbort"><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span></span><span>
</span><span id="line-321"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span id="local-6989586621679054396"><span id="local-6989586621679054398"><span id="local-6989586621679054406"><span class="annot"><span class="annottext">Int -&gt; ExitCase a -&gt; ShowS
[ExitCase a] -&gt; ShowS
ExitCase a -&gt; String
(Int -&gt; ExitCase a -&gt; ShowS)
-&gt; (ExitCase a -&gt; String)
-&gt; ([ExitCase a] -&gt; ShowS)
-&gt; Show (ExitCase a)
forall a. Show a =&gt; Int -&gt; ExitCase a -&gt; ShowS
forall a. Show a =&gt; [ExitCase a] -&gt; ShowS
forall a. Show a =&gt; ExitCase a -&gt; String
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [ExitCase a] -&gt; ShowS
$cshowList :: forall a. Show a =&gt; [ExitCase a] -&gt; ShowS
show :: ExitCase a -&gt; String
$cshow :: forall a. Show a =&gt; ExitCase a -&gt; String
showsPrec :: Int -&gt; ExitCase a -&gt; ShowS
$cshowsPrec :: forall a. Show a =&gt; Int -&gt; ExitCase a -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span>
</span><span id="line-322"></span><span>
</span><span id="line-323"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-324"></span><span>  </span><span id="local-6989586621679054387"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; [a]
</span><a href="#local-6989586621679054387"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span class="annot"><span class="annottext">e
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-325"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-326"></span><span>  </span><span id="local-6989586621679054380"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; Maybe a
</span><a href="#local-6989586621679054380"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span class="annot"><span class="annottext">e
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe a
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-327"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="../../template-haskell/src/Language.Haskell.TH.Syntax.html#Q"><span class="hs-identifier hs-type">Q</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-328"></span><span>  </span><span id="local-6989586621679054368"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; Q a
</span><a href="#local-6989586621679054368"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Q a
forall (m :: * -&gt; *) a. MonadFail m =&gt; String -&gt; m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Q a) -&gt; (e -&gt; String) -&gt; e -&gt; Q a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span>
</span><span id="line-329"></span><span>
</span><span id="line-330"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-331"></span><span>  </span><span id="local-6989586621679054358"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="#local-6989586621679054358"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; IO a
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">ControlException.throwIO</span></a></span><span>
</span><span id="line-332"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-333"></span><span>  </span><span id="local-6989586621679054349"><span class="annot"><span class="annottext">catch :: forall e a. Exception e =&gt; IO a -&gt; (e -&gt; IO a) -&gt; IO a
</span><a href="#local-6989586621679054349"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (e -&gt; IO a) -&gt; IO a
forall e a. Exception e =&gt; IO a -&gt; (e -&gt; IO a) -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#catch"><span class="hs-identifier hs-var">ControlException.catch</span></a></span><span>
</span><span id="line-334"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-335"></span><span>  </span><span id="local-6989586621679054340"><span class="annot"><span class="annottext">mask :: forall b. ((forall a. IO a -&gt; IO a) -&gt; IO b) -&gt; IO b
</span><a href="#local-6989586621679054340"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((forall a. IO a -&gt; IO a) -&gt; IO b) -&gt; IO b
forall b. ((forall a. IO a -&gt; IO a) -&gt; IO b) -&gt; IO b
</span><a href="../../base/src/GHC.IO.html#mask"><span class="hs-identifier hs-var">ControlException.mask</span></a></span><span>
</span><span id="line-336"></span><span>  </span><span id="local-6989586621679054338"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b. ((forall a. IO a -&gt; IO a) -&gt; IO b) -&gt; IO b
</span><a href="#local-6989586621679054338"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((forall a. IO a -&gt; IO a) -&gt; IO b) -&gt; IO b
forall b. ((forall a. IO a -&gt; IO a) -&gt; IO b) -&gt; IO b
</span><a href="../../base/src/GHC.IO.html#uninterruptibleMask"><span class="hs-identifier hs-var">ControlException.uninterruptibleMask</span></a></span><span>
</span><span id="line-337"></span><span>  </span><span id="local-6989586621679054325"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
IO a -&gt; (a -&gt; ExitCase b -&gt; IO c) -&gt; (a -&gt; IO b) -&gt; IO (b, c)
</span><a href="#local-6989586621679054325"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679054324"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679054324"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679054323"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; IO c
</span><a href="#local-6989586621679054323"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679054322"><span class="annot"><span class="annottext">a -&gt; IO b
</span><a href="#local-6989586621679054322"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((forall a. IO a -&gt; IO a) -&gt; IO (b, c)) -&gt; IO (b, c)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. IO a -&gt; IO a) -&gt; IO (b, c)) -&gt; IO (b, c))
-&gt; ((forall a. IO a -&gt; IO a) -&gt; IO (b, c)) -&gt; IO (b, c)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054321"><span class="annot"><span class="annottext">forall a. IO a -&gt; IO a
</span><a href="#local-6989586621679054321"><span class="hs-identifier hs-var">unmasked</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-338"></span><span>    </span><span id="local-6989586621679054320"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054320"><span class="hs-identifier hs-var">resource</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679054324"><span class="hs-identifier hs-var">acquire</span></a></span><span>
</span><span id="line-339"></span><span>    </span><span id="local-6989586621679054319"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054319"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO b -&gt; IO b
forall a. IO a -&gt; IO a
</span><a href="#local-6989586621679054321"><span class="hs-identifier hs-var">unmasked</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; IO b
</span><a href="#local-6989586621679054322"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054320"><span class="hs-identifier hs-var">resource</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IO b -&gt; (SomeException -&gt; IO b) -&gt; IO b
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-operator hs-var">`catch`</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054318"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679054318"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-340"></span><span>      </span><span class="annot"><span class="annottext">c
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; IO c
</span><a href="#local-6989586621679054323"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054320"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; ExitCase b
forall a. SomeException -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-var">ExitCaseException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679054318"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-341"></span><span>      </span><span class="annot"><span class="annottext">SomeException -&gt; IO b
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679054318"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-342"></span><span>    </span><span id="local-6989586621679054317"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679054317"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; IO c
</span><a href="#local-6989586621679054323"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054320"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; ExitCase b
forall a. a -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-var">ExitCaseSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054319"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span>    </span><span class="annot"><span class="annottext">(b, c) -&gt; IO (b, c)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054319"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679054317"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-344"></span><span>
</span><span id="line-345"></span><span id="local-6989586621679055163"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.ST.html#ST"><span class="hs-identifier hs-type">ST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055163"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-346"></span><span>  </span><span id="local-6989586621679054309"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; ST s a
</span><a href="#local-6989586621679054309"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; ST s a
forall a s. IO a -&gt; ST s a
</span><a href="../../base/src/GHC.IO.html#unsafeIOToST"><span class="hs-identifier hs-var">unsafeIOToST</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; ST s a) -&gt; (e -&gt; IO a) -&gt; e -&gt; ST s a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; IO a
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="../../base/src/GHC.IO.html#throwIO"><span class="hs-identifier hs-var">ControlException.throwIO</span></a></span></span><span>
</span><span id="line-347"></span><span>
</span><span id="line-348"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Conc.Sync.html#STM"><span class="hs-identifier hs-type">STM</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-349"></span><span>  </span><span id="local-6989586621679054301"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; STM a
</span><a href="#local-6989586621679054301"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; STM a
forall e a. Exception e =&gt; e -&gt; STM a
</span><a href="../../base/src/GHC.Conc.Sync.html#throwSTM"><span class="hs-identifier hs-var">STM.throwSTM</span></a></span><span>
</span><span id="line-350"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Conc.Sync.html#STM"><span class="hs-identifier hs-type">STM</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-351"></span><span>  </span><span id="local-6989586621679054293"><span class="annot"><span class="annottext">catch :: forall e a. Exception e =&gt; STM a -&gt; (e -&gt; STM a) -&gt; STM a
</span><a href="#local-6989586621679054293"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">STM a -&gt; (e -&gt; STM a) -&gt; STM a
forall e a. Exception e =&gt; STM a -&gt; (e -&gt; STM a) -&gt; STM a
</span><a href="../../base/src/GHC.Conc.Sync.html#catchSTM"><span class="hs-identifier hs-var">STM.catchSTM</span></a></span><span>
</span><span id="line-352"></span><span>
</span><span id="line-353"></span><span id="local-6989586621679055151"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="#local-6989586621679055151"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><span class="hs-operator hs-type">~</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055151"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-354"></span><span>  </span><span id="local-6989586621679054281"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; Either e a
</span><a href="#local-6989586621679054281"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; Either SomeException a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">(SomeException -&gt; Either SomeException a)
-&gt; (e -&gt; SomeException) -&gt; e -&gt; Either SomeException a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; SomeException
forall e. Exception e =&gt; e -&gt; SomeException
</span><a href="../../base/src/GHC.Exception.Type.html#toException"><span class="hs-identifier hs-var">toException</span></a></span></span><span>
</span><span id="line-355"></span><span class="hs-comment">-- | @since 0.8.3</span><span>
</span><span id="line-356"></span><span id="local-6989586621679055145"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="#local-6989586621679055145"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><span class="hs-operator hs-type">~</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055145"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-357"></span><span>  </span><span id="local-6989586621679054269"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
Either e a -&gt; (e -&gt; Either e a) -&gt; Either e a
</span><a href="#local-6989586621679054269"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679054268"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054268"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679054267"><span class="annot"><span class="annottext">e -&gt; Either e a
</span><a href="#local-6989586621679054267"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-358"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; Maybe e
forall e. Exception e =&gt; SomeException -&gt; Maybe e
</span><a href="../../base/src/GHC.Exception.Type.html#fromException"><span class="hs-identifier hs-var">fromException</span></a></span><span> </span><span class="annot"><span class="annottext">e
SomeException
</span><a href="#local-6989586621679054268"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-359"></span><span>      </span><span class="annot"><span class="annottext">Maybe e
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054268"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-360"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679054265"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054265"><span class="hs-identifier hs-var">e'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e a
</span><a href="#local-6989586621679054267"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054265"><span class="hs-identifier hs-var">e'</span></a></span><span>
</span><span id="line-361"></span><span>  </span><span class="annot"><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span> </span><span id="local-6989586621679054264"><span class="annot"><span class="annottext">x :: Either e a
</span><a href="#local-6989586621679054264"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679054264"><span class="hs-identifier hs-var">x</span></a></span></span><span>
</span><span id="line-362"></span><span class="hs-comment">-- | @since 0.8.3</span><span>
</span><span id="line-363"></span><span id="local-6989586621679055141"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="#local-6989586621679055141"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><span class="hs-operator hs-type">~</span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055141"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-364"></span><span>  </span><span id="local-6989586621679054253"><span class="annot"><span class="annottext">mask :: forall b.
((forall a. Either e a -&gt; Either e a) -&gt; Either e b) -&gt; Either e b
</span><a href="#local-6989586621679054253"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span id="local-6989586621679054252"><span class="annot"><span class="annottext">(forall a. Either e a -&gt; Either e a) -&gt; Either e b
</span><a href="#local-6989586621679054252"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall a. Either e a -&gt; Either e a) -&gt; Either e b
</span><a href="#local-6989586621679054252"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">forall a. a -&gt; a
forall a. Either e a -&gt; Either e a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-365"></span><span>  </span><span id="local-6989586621679054250"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b.
((forall a. Either e a -&gt; Either e a) -&gt; Either e b) -&gt; Either e b
</span><a href="#local-6989586621679054250"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span id="local-6989586621679054249"><span class="annot"><span class="annottext">(forall a. Either e a -&gt; Either e a) -&gt; Either e b
</span><a href="#local-6989586621679054249"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(forall a. Either e a -&gt; Either e a) -&gt; Either e b
</span><a href="#local-6989586621679054249"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">forall a. a -&gt; a
forall a. Either e a -&gt; Either e a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-366"></span><span>
</span><span id="line-367"></span><span>  </span><span id="local-6989586621679054244"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
Either e a
-&gt; (a -&gt; ExitCase b -&gt; Either e c)
-&gt; (a -&gt; Either e b)
-&gt; Either e (b, c)
</span><a href="#local-6989586621679054244"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679054243"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679054243"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679054242"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; Either e c
</span><a href="#local-6989586621679054242"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679054241"><span class="annot"><span class="annottext">a -&gt; Either e b
</span><a href="#local-6989586621679054241"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-368"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679054243"><span class="hs-identifier hs-var">acquire</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-369"></span><span>      </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679054240"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054240"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e (b, c)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054240"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-370"></span><span>      </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679054239"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054239"><span class="hs-identifier hs-var">resource</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-371"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">a -&gt; Either e b
</span><a href="#local-6989586621679054241"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054239"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-372"></span><span>          </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679054238"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054238"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; Either e c
</span><a href="#local-6989586621679054242"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054239"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; ExitCase b
forall a. SomeException -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-var">ExitCaseException</span></a></span><span> </span><span class="annot"><span class="annottext">e
SomeException
</span><a href="#local-6989586621679054238"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Either e c -&gt; Either e (b, c) -&gt; Either e (b, c)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e (b, c)
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054238"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-373"></span><span>          </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679054237"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054237"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-374"></span><span>            </span><span id="local-6989586621679054236"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679054236"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; Either e c
</span><a href="#local-6989586621679054242"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054239"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; ExitCase b
forall a. a -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-var">ExitCaseSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054237"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-375"></span><span>            </span><span class="annot"><span class="annottext">(b, c) -&gt; Either e (b, c)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054237"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679054236"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-376"></span><span>
</span><span id="line-377"></span><span id="local-6989586621679055129"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055129"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-type">IdentityT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055129"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-378"></span><span>  </span><span id="local-6989586621679054222"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; IdentityT m a
</span><a href="#local-6989586621679054222"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span id="local-6989586621679054221"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054221"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; IdentityT m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; IdentityT m a) -&gt; m a -&gt; IdentityT m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054221"><span class="hs-identifier hs-var">e</span></a></span></span><span>
</span><span id="line-379"></span><span id="local-6989586621679055121"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055121"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-type">IdentityT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055121"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-380"></span><span>  </span><span id="local-6989586621679054210"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
IdentityT m a -&gt; (e -&gt; IdentityT m a) -&gt; IdentityT m a
</span><a href="#local-6989586621679054210"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-type">IdentityT</span></a></span><span> </span><span id="local-6989586621679054208"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679054208"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679054207"><span class="annot"><span class="annottext">e -&gt; IdentityT m a
</span><a href="#local-6989586621679054207"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; IdentityT m a
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; IdentityT f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-var">IdentityT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m a -&gt; (e -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679054208"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdentityT m a -&gt; m a
forall {k} (f :: k -&gt; *) (a :: k). IdentityT f a -&gt; f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#runIdentityT"><span class="hs-identifier hs-var hs-var">runIdentityT</span></a></span><span> </span><span class="annot"><span class="annottext">(IdentityT m a -&gt; m a) -&gt; (e -&gt; IdentityT m a) -&gt; e -&gt; m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; IdentityT m a
</span><a href="#local-6989586621679054207"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-381"></span><span id="local-6989586621679055111"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055111"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-type">IdentityT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055111"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-382"></span><span>  </span><span id="local-6989586621679054196"><span class="annot"><span class="annottext">mask :: forall b.
((forall a. IdentityT m a -&gt; IdentityT m a) -&gt; IdentityT m b)
-&gt; IdentityT m b
</span><a href="#local-6989586621679054196"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span id="local-6989586621679054195"><span class="annot"><span class="annottext">(forall a. IdentityT m a -&gt; IdentityT m a) -&gt; IdentityT m b
</span><a href="#local-6989586621679054195"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m b -&gt; IdentityT m b
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; IdentityT f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-var">IdentityT</span></a></span><span> </span><span class="annot"><span class="annottext">(m b -&gt; IdentityT m b) -&gt; m b -&gt; IdentityT m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b)
-&gt; ((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054194"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679054194"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IdentityT m b -&gt; m b
forall {k} (f :: k -&gt; *) (a :: k). IdentityT f a -&gt; f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#runIdentityT"><span class="hs-identifier hs-var hs-var">runIdentityT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. IdentityT m a -&gt; IdentityT m a) -&gt; IdentityT m b
</span><a href="#local-6989586621679054195"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. IdentityT m a -&gt; IdentityT m a) -&gt; IdentityT m b)
-&gt; (forall a. IdentityT m a -&gt; IdentityT m a) -&gt; IdentityT m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m a) -&gt; IdentityT m a -&gt; IdentityT m a
forall (m :: * -&gt; *) a.
(m a -&gt; m a) -&gt; IdentityT m a -&gt; IdentityT m a
</span><a href="#local-6989586621679054193"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m a
forall a. m a -&gt; m a
</span><a href="#local-6989586621679054194"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-383"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679055107"><span id="local-6989586621679055108"><span class="annot"><a href="#local-6989586621679054193"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055108"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055107"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055108"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055107"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-type">IdentityT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055108"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055107"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-type">IdentityT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055108"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055107"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-384"></span><span>          </span><span id="local-6989586621679054193"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a.
(m a -&gt; m a) -&gt; IdentityT m a -&gt; IdentityT m a
</span><a href="#local-6989586621679054193"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679054192"><span class="annot"><span class="annottext">m a -&gt; m a
</span><a href="#local-6989586621679054192"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; IdentityT m a
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; IdentityT f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-var">IdentityT</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; IdentityT m a)
-&gt; (IdentityT m a -&gt; m a) -&gt; IdentityT m a -&gt; IdentityT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m a
</span><a href="#local-6989586621679054192"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m a) -&gt; (IdentityT m a -&gt; m a) -&gt; IdentityT m a -&gt; m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">IdentityT m a -&gt; m a
forall {k} (f :: k -&gt; *) (a :: k). IdentityT f a -&gt; f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#runIdentityT"><span class="hs-identifier hs-var hs-var">runIdentityT</span></a></span><span>
</span><span id="line-385"></span><span>  </span><span id="local-6989586621679054190"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b.
((forall a. IdentityT m a -&gt; IdentityT m a) -&gt; IdentityT m b)
-&gt; IdentityT m b
</span><a href="#local-6989586621679054190"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span id="local-6989586621679054189"><span class="annot"><span class="annottext">(forall a. IdentityT m a -&gt; IdentityT m a) -&gt; IdentityT m b
</span><a href="#local-6989586621679054189"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-386"></span><span>    </span><span class="annot"><span class="annottext">m b -&gt; IdentityT m b
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; IdentityT f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-var">IdentityT</span></a></span><span> </span><span class="annot"><span class="annottext">(m b -&gt; IdentityT m b) -&gt; m b -&gt; IdentityT m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-var">uninterruptibleMask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b)
-&gt; ((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054188"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679054188"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IdentityT m b -&gt; m b
forall {k} (f :: k -&gt; *) (a :: k). IdentityT f a -&gt; f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#runIdentityT"><span class="hs-identifier hs-var hs-var">runIdentityT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. IdentityT m a -&gt; IdentityT m a) -&gt; IdentityT m b
</span><a href="#local-6989586621679054189"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. IdentityT m a -&gt; IdentityT m a) -&gt; IdentityT m b)
-&gt; (forall a. IdentityT m a -&gt; IdentityT m a) -&gt; IdentityT m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m a) -&gt; IdentityT m a -&gt; IdentityT m a
forall (m :: * -&gt; *) a.
(m a -&gt; m a) -&gt; IdentityT m a -&gt; IdentityT m a
</span><a href="#local-6989586621679054187"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m a
forall a. m a -&gt; m a
</span><a href="#local-6989586621679054188"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-387"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679054185"><span id="local-6989586621679054186"><span class="annot"><a href="#local-6989586621679054187"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054186"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054185"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054186"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054185"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-type">IdentityT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054186"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054185"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-type">IdentityT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054186"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054185"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-388"></span><span>            </span><span id="local-6989586621679054187"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a.
(m a -&gt; m a) -&gt; IdentityT m a -&gt; IdentityT m a
</span><a href="#local-6989586621679054187"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679054184"><span class="annot"><span class="annottext">m a -&gt; m a
</span><a href="#local-6989586621679054184"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; IdentityT m a
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; IdentityT f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-var">IdentityT</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; IdentityT m a)
-&gt; (IdentityT m a -&gt; m a) -&gt; IdentityT m a -&gt; IdentityT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m a
</span><a href="#local-6989586621679054184"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m a) -&gt; (IdentityT m a -&gt; m a) -&gt; IdentityT m a -&gt; m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">IdentityT m a -&gt; m a
forall {k} (f :: k -&gt; *) (a :: k). IdentityT f a -&gt; f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#runIdentityT"><span class="hs-identifier hs-var hs-var">runIdentityT</span></a></span><span>
</span><span id="line-389"></span><span>
</span><span id="line-390"></span><span>  </span><span id="local-6989586621679054182"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
IdentityT m a
-&gt; (a -&gt; ExitCase b -&gt; IdentityT m c)
-&gt; (a -&gt; IdentityT m b)
-&gt; IdentityT m (b, c)
</span><a href="#local-6989586621679054182"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679054181"><span class="annot"><span class="annottext">IdentityT m a
</span><a href="#local-6989586621679054181"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679054180"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; IdentityT m c
</span><a href="#local-6989586621679054180"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679054179"><span class="annot"><span class="annottext">a -&gt; IdentityT m b
</span><a href="#local-6989586621679054179"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (b, c) -&gt; IdentityT m (b, c)
forall {k} (f :: k -&gt; *) (a :: k). f a -&gt; IdentityT f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#IdentityT"><span class="hs-identifier hs-var">IdentityT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (b, c) -&gt; IdentityT m (b, c)) -&gt; m (b, c) -&gt; IdentityT m (b, c)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-391"></span><span>    </span><span class="annot"><span class="annottext">m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-392"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdentityT m a -&gt; m a
forall {k} (f :: k -&gt; *) (a :: k). IdentityT f a -&gt; f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#runIdentityT"><span class="hs-identifier hs-var hs-var">runIdentityT</span></a></span><span> </span><span class="annot"><span class="annottext">IdentityT m a
</span><a href="#local-6989586621679054181"><span class="hs-identifier hs-var">acquire</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-393"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679054178"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054178"><span class="hs-identifier hs-var">resource</span></a></span></span><span> </span><span id="local-6989586621679054177"><span class="annot"><span class="annottext">ExitCase b
</span><a href="#local-6989586621679054177"><span class="hs-identifier hs-var">exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IdentityT m c -&gt; m c
forall {k} (f :: k -&gt; *) (a :: k). IdentityT f a -&gt; f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#runIdentityT"><span class="hs-identifier hs-var hs-var">runIdentityT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; IdentityT m c
</span><a href="#local-6989586621679054180"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054178"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCase b
</span><a href="#local-6989586621679054177"><span class="hs-identifier hs-var">exitCase</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-394"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679054176"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054176"><span class="hs-identifier hs-var">resource</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">IdentityT m b -&gt; m b
forall {k} (f :: k -&gt; *) (a :: k). IdentityT f a -&gt; f a
</span><a href="../../transformers/src/Control.Monad.Trans.Identity.html#runIdentityT"><span class="hs-identifier hs-var hs-var">runIdentityT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; IdentityT m b
</span><a href="#local-6989586621679054179"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054176"><span class="hs-identifier hs-var">resource</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-395"></span><span>
</span><span id="line-396"></span><span id="local-6989586621679055091"><span id="local-6989586621679055092"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055092"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">LazyS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055091"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055092"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-397"></span><span>  </span><span id="local-6989586621679054162"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; StateT s m a
</span><a href="#local-6989586621679054162"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span id="local-6989586621679054161"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054161"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; StateT s m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; StateT s m a) -&gt; m a -&gt; StateT s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054161"><span class="hs-identifier hs-var">e</span></a></span></span></span><span>
</span><span id="line-398"></span><span id="local-6989586621679055084"><span id="local-6989586621679055085"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055085"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">LazyS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055084"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055085"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-399"></span><span>  </span><span id="local-6989586621679054151"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
StateT s m a -&gt; (e -&gt; StateT s m a) -&gt; StateT s m a
</span><a href="#local-6989586621679054151"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s) -&gt; Catch e (StateT s m) a
forall e (m :: * -&gt; *) a s.
Catch e m (a, s) -&gt; Catch e (StateT s m) a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#liftCatch"><span class="hs-identifier hs-var">LazyS.liftCatch</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s)
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span></span></span><span>
</span><span id="line-400"></span><span id="local-6989586621679055073"><span id="local-6989586621679055074"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055074"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">LazyS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055073"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055074"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-401"></span><span>  </span><span id="local-6989586621679054138"><span class="annot"><span class="annottext">mask :: forall b.
((forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b)
-&gt; StateT s m b
</span><a href="#local-6989586621679054138"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span id="local-6989586621679054137"><span class="annot"><span class="annottext">(forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b
</span><a href="#local-6989586621679054137"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; m (b, s)) -&gt; StateT s m b
forall s (m :: * -&gt; *) a. (s -&gt; m (a, s)) -&gt; StateT s m a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-var">LazyS.StateT</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; m (b, s)) -&gt; StateT s m b)
-&gt; (s -&gt; m (b, s)) -&gt; StateT s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054135"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054135"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (b, s)) -&gt; m (b, s)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (b, s)) -&gt; m (b, s))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (b, s)) -&gt; m (b, s)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054134"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679054134"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StateT s m b -&gt; s -&gt; m (b, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#runStateT"><span class="hs-identifier hs-var hs-var">LazyS.runStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b
</span><a href="#local-6989586621679054137"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b)
-&gt; (forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
forall (m :: * -&gt; *) a s.
(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
</span><a href="#local-6989586621679054132"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, s) -&gt; m (a, s)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679054134"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054135"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-402"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679055062"><span id="local-6989586621679055063"><span id="local-6989586621679055064"><span class="annot"><a href="#local-6989586621679054132"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055064"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055063"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679055062"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055064"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055063"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679055062"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">LazyS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055062"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055064"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055063"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">LazyS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055062"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055064"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055063"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-403"></span><span>          </span><span id="local-6989586621679054132"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a s.
(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
</span><a href="#local-6989586621679054132"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679054131"><span class="annot"><span class="annottext">m (a, s) -&gt; m (a, s)
</span><a href="#local-6989586621679054131"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">LazyS.StateT</span></a></span><span> </span><span id="local-6989586621679054130"><span class="annot"><span class="annottext">s -&gt; m (a, s)
</span><a href="#local-6989586621679054130"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; m (a, s)) -&gt; StateT s m a
forall s (m :: * -&gt; *) a. (s -&gt; m (a, s)) -&gt; StateT s m a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-var">LazyS.StateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m (a, s) -&gt; m (a, s)
</span><a href="#local-6989586621679054131"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, s) -&gt; m (a, s)) -&gt; (s -&gt; m (a, s)) -&gt; s -&gt; m (a, s)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">s -&gt; m (a, s)
</span><a href="#local-6989586621679054130"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-404"></span><span>  </span><span id="local-6989586621679054128"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b.
((forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b)
-&gt; StateT s m b
</span><a href="#local-6989586621679054128"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span id="local-6989586621679054127"><span class="annot"><span class="annottext">(forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b
</span><a href="#local-6989586621679054127"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-405"></span><span>    </span><span class="annot"><span class="annottext">(s -&gt; m (b, s)) -&gt; StateT s m b
forall s (m :: * -&gt; *) a. (s -&gt; m (a, s)) -&gt; StateT s m a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-var">LazyS.StateT</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; m (b, s)) -&gt; StateT s m b)
-&gt; (s -&gt; m (b, s)) -&gt; StateT s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054126"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054126"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (b, s)) -&gt; m (b, s)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-var">uninterruptibleMask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (b, s)) -&gt; m (b, s))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (b, s)) -&gt; m (b, s)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054125"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679054125"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StateT s m b -&gt; s -&gt; m (b, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#runStateT"><span class="hs-identifier hs-var hs-var">LazyS.runStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b
</span><a href="#local-6989586621679054127"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b)
-&gt; (forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
forall (m :: * -&gt; *) a s.
(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
</span><a href="#local-6989586621679054124"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, s) -&gt; m (a, s)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679054125"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054126"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-406"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679054121"><span id="local-6989586621679054122"><span id="local-6989586621679054123"><span class="annot"><a href="#local-6989586621679054124"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054123"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054122"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054121"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054123"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054122"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054121"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">LazyS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054121"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054123"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054122"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">LazyS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054121"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054123"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054122"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-407"></span><span>            </span><span id="local-6989586621679054124"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a s.
(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
</span><a href="#local-6989586621679054124"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679054120"><span class="annot"><span class="annottext">m (a, s) -&gt; m (a, s)
</span><a href="#local-6989586621679054120"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-type">LazyS.StateT</span></a></span><span> </span><span id="local-6989586621679054119"><span class="annot"><span class="annottext">s -&gt; m (a, s)
</span><a href="#local-6989586621679054119"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; m (a, s)) -&gt; StateT s m a
forall s (m :: * -&gt; *) a. (s -&gt; m (a, s)) -&gt; StateT s m a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-var">LazyS.StateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m (a, s) -&gt; m (a, s)
</span><a href="#local-6989586621679054120"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, s) -&gt; m (a, s)) -&gt; (s -&gt; m (a, s)) -&gt; s -&gt; m (a, s)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">s -&gt; m (a, s)
</span><a href="#local-6989586621679054119"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-408"></span><span>
</span><span id="line-409"></span><span>  </span><span id="local-6989586621679054115"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
StateT s m a
-&gt; (a -&gt; ExitCase b -&gt; StateT s m c)
-&gt; (a -&gt; StateT s m b)
-&gt; StateT s m (b, c)
</span><a href="#local-6989586621679054115"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679054114"><span class="annot"><span class="annottext">StateT s m a
</span><a href="#local-6989586621679054114"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679054113"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; StateT s m c
</span><a href="#local-6989586621679054113"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679054112"><span class="annot"><span class="annottext">a -&gt; StateT s m b
</span><a href="#local-6989586621679054112"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; m ((b, c), s)) -&gt; StateT s m (b, c)
forall s (m :: * -&gt; *) a. (s -&gt; m (a, s)) -&gt; StateT s m a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#StateT"><span class="hs-identifier hs-var">LazyS.StateT</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; m ((b, c), s)) -&gt; StateT s m (b, c))
-&gt; (s -&gt; m ((b, c), s)) -&gt; StateT s m (b, c)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054111"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054111"><span class="hs-identifier hs-var">s0</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-410"></span><span>    </span><span class="hs-comment">-- This implementation is given as an example in the documentation of</span><span>
</span><span id="line-411"></span><span>    </span><span class="hs-comment">-- 'generalBracket', so when changing it, remember to update the</span><span>
</span><span id="line-412"></span><span>    </span><span class="hs-comment">-- documentation's copy as well</span><span>
</span><span id="line-413"></span><span>    </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621679054110"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054110"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054109"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054109"><span class="hs-identifier hs-var">_s2</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679054108"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679054108"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054107"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054107"><span class="hs-identifier hs-var">s3</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (a, s)
-&gt; ((a, s) -&gt; ExitCase (b, s) -&gt; m (c, s))
-&gt; ((a, s) -&gt; m (b, s))
-&gt; m ((b, s), (c, s))
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-414"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StateT s m a -&gt; s -&gt; m (a, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#runStateT"><span class="hs-identifier hs-var hs-var">LazyS.runStateT</span></a></span><span> </span><span class="annot"><span class="annottext">StateT s m a
</span><a href="#local-6989586621679054114"><span class="hs-identifier hs-var">acquire</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054111"><span class="hs-identifier hs-var">s0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-415"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679054106"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054106"><span class="hs-identifier hs-var">resource</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054105"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054105"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679054104"><span class="annot"><span class="annottext">ExitCase (b, s)
</span><a href="#local-6989586621679054104"><span class="hs-identifier hs-var">exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ExitCase (b, s)
</span><a href="#local-6989586621679054104"><span class="hs-identifier hs-var">exitCase</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-416"></span><span>        </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-type">ExitCaseSuccess</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679054103"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054103"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054102"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054102"><span class="hs-identifier hs-var">s2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StateT s m c -&gt; s -&gt; m (c, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#runStateT"><span class="hs-identifier hs-var hs-var">LazyS.runStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; StateT s m c
</span><a href="#local-6989586621679054113"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054106"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; ExitCase b
forall a. a -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-var">ExitCaseSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054103"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054102"><span class="hs-identifier hs-var">s2</span></a></span><span>
</span><span id="line-417"></span><span>        </span><span class="hs-comment">-- In the two other cases, the base monad overrides @use@'s state</span><span>
</span><span id="line-418"></span><span>        </span><span class="hs-comment">-- changes and the state reverts to @s1@.</span><span>
</span><span id="line-419"></span><span>        </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-type">ExitCaseException</span></a></span><span> </span><span id="local-6989586621679054101"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679054101"><span class="hs-identifier hs-var">e</span></a></span></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StateT s m c -&gt; s -&gt; m (c, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#runStateT"><span class="hs-identifier hs-var hs-var">LazyS.runStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; StateT s m c
</span><a href="#local-6989586621679054113"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054106"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; ExitCase b
forall a. SomeException -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-var">ExitCaseException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679054101"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054105"><span class="hs-identifier hs-var">s1</span></a></span><span>
</span><span id="line-420"></span><span>        </span><span class="annot"><span class="annottext">ExitCase (b, s)
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StateT s m c -&gt; s -&gt; m (c, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#runStateT"><span class="hs-identifier hs-var hs-var">LazyS.runStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; StateT s m c
</span><a href="#local-6989586621679054113"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054106"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCase b
forall a. ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054105"><span class="hs-identifier hs-var">s1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-421"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679054100"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054100"><span class="hs-identifier hs-var">resource</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054099"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054099"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StateT s m b -&gt; s -&gt; m (b, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Lazy.html#runStateT"><span class="hs-identifier hs-var hs-var">LazyS.runStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; StateT s m b
</span><a href="#local-6989586621679054112"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054100"><span class="hs-identifier hs-var">resource</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054099"><span class="hs-identifier hs-var">s1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-422"></span><span>    </span><span class="annot"><span class="annottext">((b, c), s) -&gt; m ((b, c), s)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054110"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679054108"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054107"><span class="hs-identifier hs-var">s3</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-423"></span><span>
</span><span id="line-424"></span><span id="local-6989586621679055044"><span id="local-6989586621679055045"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055045"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">StrictS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055044"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055045"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-425"></span><span>  </span><span id="local-6989586621679054085"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; StateT s m a
</span><a href="#local-6989586621679054085"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span id="local-6989586621679054084"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054084"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; StateT s m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; StateT s m a) -&gt; m a -&gt; StateT s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054084"><span class="hs-identifier hs-var">e</span></a></span></span></span><span>
</span><span id="line-426"></span><span id="local-6989586621679055037"><span id="local-6989586621679055038"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055038"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">StrictS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055037"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055038"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-427"></span><span>  </span><span id="local-6989586621679054074"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
StateT s m a -&gt; (e -&gt; StateT s m a) -&gt; StateT s m a
</span><a href="#local-6989586621679054074"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s) -&gt; Catch e (StateT s m) a
forall e (m :: * -&gt; *) a s.
Catch e m (a, s) -&gt; Catch e (StateT s m) a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#liftCatch"><span class="hs-identifier hs-var">StrictS.liftCatch</span></a></span><span> </span><span class="annot"><span class="annottext">Catch e m (a, s)
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span></span></span><span>
</span><span id="line-428"></span><span id="local-6989586621679055027"><span id="local-6989586621679055028"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055028"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">StrictS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055027"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055028"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-429"></span><span>  </span><span id="local-6989586621679054061"><span class="annot"><span class="annottext">mask :: forall b.
((forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b)
-&gt; StateT s m b
</span><a href="#local-6989586621679054061"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span id="local-6989586621679054060"><span class="annot"><span class="annottext">(forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b
</span><a href="#local-6989586621679054060"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; m (b, s)) -&gt; StateT s m b
forall s (m :: * -&gt; *) a. (s -&gt; m (a, s)) -&gt; StateT s m a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-var">StrictS.StateT</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; m (b, s)) -&gt; StateT s m b)
-&gt; (s -&gt; m (b, s)) -&gt; StateT s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054058"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054058"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (b, s)) -&gt; m (b, s)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (b, s)) -&gt; m (b, s))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (b, s)) -&gt; m (b, s)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054057"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679054057"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StateT s m b -&gt; s -&gt; m (b, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#runStateT"><span class="hs-identifier hs-var hs-var">StrictS.runStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b
</span><a href="#local-6989586621679054060"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b)
-&gt; (forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
forall (m :: * -&gt; *) a s.
(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
</span><a href="#local-6989586621679054055"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, s) -&gt; m (a, s)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679054057"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054058"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-430"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679055016"><span id="local-6989586621679055017"><span id="local-6989586621679055018"><span class="annot"><a href="#local-6989586621679054055"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055018"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055017"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679055016"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679055018"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679055017"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679055016"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">StrictS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055016"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055018"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055017"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">StrictS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055016"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055018"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679055017"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-431"></span><span>          </span><span id="local-6989586621679054055"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a s.
(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
</span><a href="#local-6989586621679054055"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679054054"><span class="annot"><span class="annottext">m (a, s) -&gt; m (a, s)
</span><a href="#local-6989586621679054054"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">StrictS.StateT</span></a></span><span> </span><span id="local-6989586621679054053"><span class="annot"><span class="annottext">s -&gt; m (a, s)
</span><a href="#local-6989586621679054053"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; m (a, s)) -&gt; StateT s m a
forall s (m :: * -&gt; *) a. (s -&gt; m (a, s)) -&gt; StateT s m a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-var">StrictS.StateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m (a, s) -&gt; m (a, s)
</span><a href="#local-6989586621679054054"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, s) -&gt; m (a, s)) -&gt; (s -&gt; m (a, s)) -&gt; s -&gt; m (a, s)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">s -&gt; m (a, s)
</span><a href="#local-6989586621679054053"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span>  </span><span id="local-6989586621679054051"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b.
((forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b)
-&gt; StateT s m b
</span><a href="#local-6989586621679054051"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span id="local-6989586621679054050"><span class="annot"><span class="annottext">(forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b
</span><a href="#local-6989586621679054050"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-433"></span><span>    </span><span class="annot"><span class="annottext">(s -&gt; m (b, s)) -&gt; StateT s m b
forall s (m :: * -&gt; *) a. (s -&gt; m (a, s)) -&gt; StateT s m a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-var">StrictS.StateT</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; m (b, s)) -&gt; StateT s m b)
-&gt; (s -&gt; m (b, s)) -&gt; StateT s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054049"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054049"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (b, s)) -&gt; m (b, s)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-var">uninterruptibleMask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (b, s)) -&gt; m (b, s))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (b, s)) -&gt; m (b, s)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054048"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679054048"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StateT s m b -&gt; s -&gt; m (b, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#runStateT"><span class="hs-identifier hs-var hs-var">StrictS.runStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b
</span><a href="#local-6989586621679054050"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b)
-&gt; (forall a. StateT s m a -&gt; StateT s m a) -&gt; StateT s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
forall (m :: * -&gt; *) a s.
(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
</span><a href="#local-6989586621679054047"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, s) -&gt; m (a, s)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679054048"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054049"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-434"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679054044"><span id="local-6989586621679054045"><span id="local-6989586621679054046"><span class="annot"><a href="#local-6989586621679054047"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054046"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054045"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054044"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054046"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054045"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054044"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">StrictS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054044"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054046"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054045"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">StrictS.StateT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054044"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054046"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054045"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-435"></span><span>            </span><span id="local-6989586621679054047"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a s.
(m (a, s) -&gt; m (a, s)) -&gt; StateT s m a -&gt; StateT s m a
</span><a href="#local-6989586621679054047"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679054043"><span class="annot"><span class="annottext">m (a, s) -&gt; m (a, s)
</span><a href="#local-6989586621679054043"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-type">StrictS.StateT</span></a></span><span> </span><span id="local-6989586621679054042"><span class="annot"><span class="annottext">s -&gt; m (a, s)
</span><a href="#local-6989586621679054042"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; m (a, s)) -&gt; StateT s m a
forall s (m :: * -&gt; *) a. (s -&gt; m (a, s)) -&gt; StateT s m a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-var">StrictS.StateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m (a, s) -&gt; m (a, s)
</span><a href="#local-6989586621679054043"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, s) -&gt; m (a, s)) -&gt; (s -&gt; m (a, s)) -&gt; s -&gt; m (a, s)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">s -&gt; m (a, s)
</span><a href="#local-6989586621679054042"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-436"></span><span>
</span><span id="line-437"></span><span>  </span><span id="local-6989586621679054038"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
StateT s m a
-&gt; (a -&gt; ExitCase b -&gt; StateT s m c)
-&gt; (a -&gt; StateT s m b)
-&gt; StateT s m (b, c)
</span><a href="#local-6989586621679054038"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679054037"><span class="annot"><span class="annottext">StateT s m a
</span><a href="#local-6989586621679054037"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679054036"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; StateT s m c
</span><a href="#local-6989586621679054036"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679054035"><span class="annot"><span class="annottext">a -&gt; StateT s m b
</span><a href="#local-6989586621679054035"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; m ((b, c), s)) -&gt; StateT s m (b, c)
forall s (m :: * -&gt; *) a. (s -&gt; m (a, s)) -&gt; StateT s m a
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#StateT"><span class="hs-identifier hs-var">StrictS.StateT</span></a></span><span> </span><span class="annot"><span class="annottext">((s -&gt; m ((b, c), s)) -&gt; StateT s m (b, c))
-&gt; (s -&gt; m ((b, c), s)) -&gt; StateT s m (b, c)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679054034"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054034"><span class="hs-identifier hs-var">s0</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-438"></span><span>    </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621679054033"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054033"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054032"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054032"><span class="hs-identifier hs-var">_s2</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679054031"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679054031"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054030"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054030"><span class="hs-identifier hs-var">s3</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (a, s)
-&gt; ((a, s) -&gt; ExitCase (b, s) -&gt; m (c, s))
-&gt; ((a, s) -&gt; m (b, s))
-&gt; m ((b, s), (c, s))
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-439"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">StateT s m a -&gt; s -&gt; m (a, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#runStateT"><span class="hs-identifier hs-var hs-var">StrictS.runStateT</span></a></span><span> </span><span class="annot"><span class="annottext">StateT s m a
</span><a href="#local-6989586621679054037"><span class="hs-identifier hs-var">acquire</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054034"><span class="hs-identifier hs-var">s0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-440"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679054029"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054029"><span class="hs-identifier hs-var">resource</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054028"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054028"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679054027"><span class="annot"><span class="annottext">ExitCase (b, s)
</span><a href="#local-6989586621679054027"><span class="hs-identifier hs-var">exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ExitCase (b, s)
</span><a href="#local-6989586621679054027"><span class="hs-identifier hs-var">exitCase</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-441"></span><span>        </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-type">ExitCaseSuccess</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679054026"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054026"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054025"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054025"><span class="hs-identifier hs-var">s2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StateT s m c -&gt; s -&gt; m (c, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#runStateT"><span class="hs-identifier hs-var hs-var">StrictS.runStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; StateT s m c
</span><a href="#local-6989586621679054036"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054029"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; ExitCase b
forall a. a -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-var">ExitCaseSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054026"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054025"><span class="hs-identifier hs-var">s2</span></a></span><span>
</span><span id="line-442"></span><span>        </span><span class="hs-comment">-- In the two other cases, the base monad overrides @use@'s state</span><span>
</span><span id="line-443"></span><span>        </span><span class="hs-comment">-- changes and the state reverts to @s1@.</span><span>
</span><span id="line-444"></span><span>        </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-type">ExitCaseException</span></a></span><span> </span><span id="local-6989586621679054024"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679054024"><span class="hs-identifier hs-var">e</span></a></span></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StateT s m c -&gt; s -&gt; m (c, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#runStateT"><span class="hs-identifier hs-var hs-var">StrictS.runStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; StateT s m c
</span><a href="#local-6989586621679054036"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054029"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; ExitCase b
forall a. SomeException -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-var">ExitCaseException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679054024"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054028"><span class="hs-identifier hs-var">s1</span></a></span><span>
</span><span id="line-445"></span><span>        </span><span class="annot"><span class="annottext">ExitCase (b, s)
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StateT s m c -&gt; s -&gt; m (c, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#runStateT"><span class="hs-identifier hs-var hs-var">StrictS.runStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; StateT s m c
</span><a href="#local-6989586621679054036"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054029"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCase b
forall a. ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054028"><span class="hs-identifier hs-var">s1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-446"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679054023"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054023"><span class="hs-identifier hs-var">resource</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679054022"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054022"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">StateT s m b -&gt; s -&gt; m (b, s)
forall s (m :: * -&gt; *) a. StateT s m a -&gt; s -&gt; m (a, s)
</span><a href="../../transformers/src/Control.Monad.Trans.State.Strict.html#runStateT"><span class="hs-identifier hs-var hs-var">StrictS.runStateT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; StateT s m b
</span><a href="#local-6989586621679054035"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679054023"><span class="hs-identifier hs-var">resource</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054022"><span class="hs-identifier hs-var">s1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-447"></span><span>    </span><span class="annot"><span class="annottext">((b, c), s) -&gt; m ((b, c), s)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679054033"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679054031"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679054030"><span class="hs-identifier hs-var">s3</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-448"></span><span>
</span><span id="line-449"></span><span id="local-6989586621679054998"><span id="local-6989586621679054999"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054999"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-type">ReaderT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054998"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054999"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-450"></span><span>  </span><span id="local-6989586621679054008"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; ReaderT r m a
</span><a href="#local-6989586621679054008"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span id="local-6989586621679054007"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054007"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ReaderT r m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ReaderT r m a) -&gt; m a -&gt; ReaderT r m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679054007"><span class="hs-identifier hs-var">e</span></a></span></span></span><span>
</span><span id="line-451"></span><span id="local-6989586621679054991"><span id="local-6989586621679054992"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054992"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-type">ReaderT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054991"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054992"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-452"></span><span>  </span><span id="local-6989586621679053997"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
ReaderT r m a -&gt; (e -&gt; ReaderT r m a) -&gt; ReaderT r m a
</span><a href="#local-6989586621679053997"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-type">ReaderT</span></a></span><span> </span><span id="local-6989586621679053995"><span class="annot"><span class="annottext">r -&gt; m a
</span><a href="#local-6989586621679053995"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053994"><span class="annot"><span class="annottext">e -&gt; ReaderT r m a
</span><a href="#local-6989586621679053994"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; m a) -&gt; ReaderT r m a
forall r (m :: * -&gt; *) a. (r -&gt; m a) -&gt; ReaderT r m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-var">ReaderT</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; m a) -&gt; ReaderT r m a) -&gt; (r -&gt; m a) -&gt; ReaderT r m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053993"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053993"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">r -&gt; m a
</span><a href="#local-6989586621679053995"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053993"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (e -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-operator hs-var">`catch`</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053992"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053992"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ReaderT r m a -&gt; r -&gt; m a
forall r (m :: * -&gt; *) a. ReaderT r m a -&gt; r -&gt; m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#runReaderT"><span class="hs-identifier hs-var hs-var">runReaderT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; ReaderT r m a
</span><a href="#local-6989586621679053994"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053992"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053993"><span class="hs-identifier hs-var">r</span></a></span></span></span><span>
</span><span id="line-453"></span><span id="local-6989586621679054979"><span id="local-6989586621679054980"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054980"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-type">ReaderT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054979"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054980"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-454"></span><span>  </span><span id="local-6989586621679053981"><span class="annot"><span class="annottext">mask :: forall b.
((forall a. ReaderT r m a -&gt; ReaderT r m a) -&gt; ReaderT r m b)
-&gt; ReaderT r m b
</span><a href="#local-6989586621679053981"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span id="local-6989586621679053980"><span class="annot"><span class="annottext">(forall a. ReaderT r m a -&gt; ReaderT r m a) -&gt; ReaderT r m b
</span><a href="#local-6989586621679053980"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; m b) -&gt; ReaderT r m b
forall r (m :: * -&gt; *) a. (r -&gt; m a) -&gt; ReaderT r m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-var">ReaderT</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; m b) -&gt; ReaderT r m b) -&gt; (r -&gt; m b) -&gt; ReaderT r m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053979"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053979"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b)
-&gt; ((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053978"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053978"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ReaderT r m b -&gt; r -&gt; m b
forall r (m :: * -&gt; *) a. ReaderT r m a -&gt; r -&gt; m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#runReaderT"><span class="hs-identifier hs-var hs-var">runReaderT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. ReaderT r m a -&gt; ReaderT r m a) -&gt; ReaderT r m b
</span><a href="#local-6989586621679053980"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. ReaderT r m a -&gt; ReaderT r m a) -&gt; ReaderT r m b)
-&gt; (forall a. ReaderT r m a -&gt; ReaderT r m a) -&gt; ReaderT r m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m a) -&gt; ReaderT r m a -&gt; ReaderT r m a
forall (m :: * -&gt; *) a e.
(m a -&gt; m a) -&gt; ReaderT e m a -&gt; ReaderT e m a
</span><a href="#local-6989586621679053977"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m a
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053978"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053979"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-455"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679054974"><span id="local-6989586621679054975"><span id="local-6989586621679054976"><span class="annot"><a href="#local-6989586621679053977"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054976"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054975"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054976"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054975"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-type">ReaderT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054974"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054976"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054975"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-type">ReaderT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054974"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054976"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054975"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-456"></span><span>          </span><span id="local-6989586621679053977"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a e.
(m a -&gt; m a) -&gt; ReaderT e m a -&gt; ReaderT e m a
</span><a href="#local-6989586621679053977"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053976"><span class="annot"><span class="annottext">m a -&gt; m a
</span><a href="#local-6989586621679053976"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-type">ReaderT</span></a></span><span> </span><span id="local-6989586621679053975"><span class="annot"><span class="annottext">e -&gt; m a
</span><a href="#local-6989586621679053975"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(e -&gt; m a) -&gt; ReaderT e m a
forall r (m :: * -&gt; *) a. (r -&gt; m a) -&gt; ReaderT r m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-var">ReaderT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m a -&gt; m a
</span><a href="#local-6989586621679053976"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m a) -&gt; (e -&gt; m a) -&gt; e -&gt; m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
</span><a href="#local-6989586621679053975"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-457"></span><span>  </span><span id="local-6989586621679053973"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b.
((forall a. ReaderT r m a -&gt; ReaderT r m a) -&gt; ReaderT r m b)
-&gt; ReaderT r m b
</span><a href="#local-6989586621679053973"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span id="local-6989586621679053972"><span class="annot"><span class="annottext">(forall a. ReaderT r m a -&gt; ReaderT r m a) -&gt; ReaderT r m b
</span><a href="#local-6989586621679053972"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-458"></span><span>    </span><span class="annot"><span class="annottext">(r -&gt; m b) -&gt; ReaderT r m b
forall r (m :: * -&gt; *) a. (r -&gt; m a) -&gt; ReaderT r m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-var">ReaderT</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; m b) -&gt; ReaderT r m b) -&gt; (r -&gt; m b) -&gt; ReaderT r m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053971"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053971"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-var">uninterruptibleMask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b)
-&gt; ((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053970"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053970"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ReaderT r m b -&gt; r -&gt; m b
forall r (m :: * -&gt; *) a. ReaderT r m a -&gt; r -&gt; m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#runReaderT"><span class="hs-identifier hs-var hs-var">runReaderT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. ReaderT r m a -&gt; ReaderT r m a) -&gt; ReaderT r m b
</span><a href="#local-6989586621679053972"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. ReaderT r m a -&gt; ReaderT r m a) -&gt; ReaderT r m b)
-&gt; (forall a. ReaderT r m a -&gt; ReaderT r m a) -&gt; ReaderT r m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m a) -&gt; ReaderT r m a -&gt; ReaderT r m a
forall (m :: * -&gt; *) a e.
(m a -&gt; m a) -&gt; ReaderT e m a -&gt; ReaderT e m a
</span><a href="#local-6989586621679053969"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; m a
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053970"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053971"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-459"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679053966"><span id="local-6989586621679053967"><span id="local-6989586621679053968"><span class="annot"><a href="#local-6989586621679053969"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053968"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053967"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053968"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053967"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-type">ReaderT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053966"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053968"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053967"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-type">ReaderT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053966"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053968"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053967"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-460"></span><span>            </span><span id="local-6989586621679053969"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a e.
(m a -&gt; m a) -&gt; ReaderT e m a -&gt; ReaderT e m a
</span><a href="#local-6989586621679053969"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053965"><span class="annot"><span class="annottext">m a -&gt; m a
</span><a href="#local-6989586621679053965"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-type">ReaderT</span></a></span><span> </span><span id="local-6989586621679053964"><span class="annot"><span class="annottext">e -&gt; m a
</span><a href="#local-6989586621679053964"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(e -&gt; m a) -&gt; ReaderT e m a
forall r (m :: * -&gt; *) a. (r -&gt; m a) -&gt; ReaderT r m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-var">ReaderT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m a -&gt; m a
</span><a href="#local-6989586621679053965"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m a) -&gt; (e -&gt; m a) -&gt; e -&gt; m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
</span><a href="#local-6989586621679053964"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-461"></span><span>
</span><span id="line-462"></span><span>  </span><span id="local-6989586621679053962"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
ReaderT r m a
-&gt; (a -&gt; ExitCase b -&gt; ReaderT r m c)
-&gt; (a -&gt; ReaderT r m b)
-&gt; ReaderT r m (b, c)
</span><a href="#local-6989586621679053962"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679053961"><span class="annot"><span class="annottext">ReaderT r m a
</span><a href="#local-6989586621679053961"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679053960"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; ReaderT r m c
</span><a href="#local-6989586621679053960"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679053959"><span class="annot"><span class="annottext">a -&gt; ReaderT r m b
</span><a href="#local-6989586621679053959"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; m (b, c)) -&gt; ReaderT r m (b, c)
forall r (m :: * -&gt; *) a. (r -&gt; m a) -&gt; ReaderT r m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#ReaderT"><span class="hs-identifier hs-var">ReaderT</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; m (b, c)) -&gt; ReaderT r m (b, c))
-&gt; (r -&gt; m (b, c)) -&gt; ReaderT r m (b, c)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053958"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053958"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-463"></span><span>    </span><span class="annot"><span class="annottext">m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-464"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ReaderT r m a -&gt; r -&gt; m a
forall r (m :: * -&gt; *) a. ReaderT r m a -&gt; r -&gt; m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#runReaderT"><span class="hs-identifier hs-var hs-var">runReaderT</span></a></span><span> </span><span class="annot"><span class="annottext">ReaderT r m a
</span><a href="#local-6989586621679053961"><span class="hs-identifier hs-var">acquire</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053958"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-465"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679053957"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053957"><span class="hs-identifier hs-var">resource</span></a></span></span><span> </span><span id="local-6989586621679053956"><span class="annot"><span class="annottext">ExitCase b
</span><a href="#local-6989586621679053956"><span class="hs-identifier hs-var">exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ReaderT r m c -&gt; r -&gt; m c
forall r (m :: * -&gt; *) a. ReaderT r m a -&gt; r -&gt; m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#runReaderT"><span class="hs-identifier hs-var hs-var">runReaderT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; ReaderT r m c
</span><a href="#local-6989586621679053960"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053957"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCase b
</span><a href="#local-6989586621679053956"><span class="hs-identifier hs-var">exitCase</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053958"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-466"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679053955"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053955"><span class="hs-identifier hs-var">resource</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ReaderT r m b -&gt; r -&gt; m b
forall r (m :: * -&gt; *) a. ReaderT r m a -&gt; r -&gt; m a
</span><a href="../../transformers/src/Control.Monad.Trans.Reader.html#runReaderT"><span class="hs-identifier hs-var hs-var">runReaderT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ReaderT r m b
</span><a href="#local-6989586621679053959"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053955"><span class="hs-identifier hs-var">resource</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053958"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-467"></span><span>
</span><span id="line-468"></span><span id="local-6989586621679054956"><span id="local-6989586621679054957"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054957"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054956"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-type">StrictW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054956"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054957"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-469"></span><span>  </span><span id="local-6989586621679053940"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; WriterT w m a
</span><a href="#local-6989586621679053940"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span id="local-6989586621679053939"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053939"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; WriterT w m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; WriterT w m a) -&gt; m a -&gt; WriterT w m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053939"><span class="hs-identifier hs-var">e</span></a></span></span></span><span>
</span><span id="line-470"></span><span id="local-6989586621679054949"><span id="local-6989586621679054950"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054950"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054949"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-type">StrictW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054949"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054950"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-471"></span><span>  </span><span id="local-6989586621679053928"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
WriterT w m a -&gt; (e -&gt; WriterT w m a) -&gt; WriterT w m a
</span><a href="#local-6989586621679053928"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-type">StrictW.WriterT</span></a></span><span> </span><span id="local-6989586621679053926"><span class="annot"><span class="annottext">m (a, w)
</span><a href="#local-6989586621679053926"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053925"><span class="annot"><span class="annottext">e -&gt; WriterT w m a
</span><a href="#local-6989586621679053925"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; WriterT w m a
forall w (m :: * -&gt; *) a. m (a, w) -&gt; WriterT w m a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-var">StrictW.WriterT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, w) -&gt; WriterT w m a) -&gt; m (a, w) -&gt; WriterT w m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, w)
</span><a href="#local-6989586621679053926"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">`</span><span class="hs-identifier">catch</span><span> </span><span class="hs-special">`</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053924"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053924"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">WriterT w m a -&gt; m (a, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#runWriterT"><span class="hs-identifier hs-var hs-var">StrictW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; WriterT w m a
</span><a href="#local-6989586621679053925"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053924"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-472"></span><span id="local-6989586621679054937"><span id="local-6989586621679054938"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054938"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054937"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-type">StrictW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054937"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054938"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-473"></span><span>  </span><span id="local-6989586621679053910"><span class="annot"><span class="annottext">mask :: forall b.
((forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b)
-&gt; WriterT w m b
</span><a href="#local-6989586621679053910"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span id="local-6989586621679053909"><span class="annot"><span class="annottext">(forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b
</span><a href="#local-6989586621679053909"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (b, w) -&gt; WriterT w m b
forall w (m :: * -&gt; *) a. m (a, w) -&gt; WriterT w m a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-var">StrictW.WriterT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (b, w) -&gt; WriterT w m b) -&gt; m (b, w) -&gt; WriterT w m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (b, w)) -&gt; m (b, w)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (b, w)) -&gt; m (b, w))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (b, w)) -&gt; m (b, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053908"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053908"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">WriterT w m b -&gt; m (b, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#runWriterT"><span class="hs-identifier hs-var hs-var">StrictW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b
</span><a href="#local-6989586621679053909"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b)
-&gt; (forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
forall (m :: * -&gt; *) a w.
(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
</span><a href="#local-6989586621679053907"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; m (a, w)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053908"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-474"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679054932"><span id="local-6989586621679054933"><span id="local-6989586621679054934"><span class="annot"><a href="#local-6989586621679053907"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054934"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054933"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054932"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054934"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054933"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054932"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-type">StrictW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054932"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054934"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054933"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-type">StrictW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054932"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054934"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054933"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-475"></span><span>          </span><span id="local-6989586621679053907"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a w.
(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
</span><a href="#local-6989586621679053907"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053906"><span class="annot"><span class="annottext">m (a, w) -&gt; m (a, w)
</span><a href="#local-6989586621679053906"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679053905"><span class="annot"><span class="annottext">WriterT w m a
</span><a href="#local-6989586621679053905"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; WriterT w m a
forall w (m :: * -&gt; *) a. m (a, w) -&gt; WriterT w m a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-var">StrictW.WriterT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, w) -&gt; WriterT w m a) -&gt; m (a, w) -&gt; WriterT w m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; m (a, w)
</span><a href="#local-6989586621679053906"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WriterT w m a -&gt; m (a, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#runWriterT"><span class="hs-identifier hs-var hs-var">StrictW.runWriterT</span></a></span><span> </span><span class="annot"><span class="annottext">WriterT w m a
</span><a href="#local-6989586621679053905"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-476"></span><span>  </span><span id="local-6989586621679053903"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b.
((forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b)
-&gt; WriterT w m b
</span><a href="#local-6989586621679053903"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span id="local-6989586621679053902"><span class="annot"><span class="annottext">(forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b
</span><a href="#local-6989586621679053902"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-477"></span><span>    </span><span class="annot"><span class="annottext">m (b, w) -&gt; WriterT w m b
forall w (m :: * -&gt; *) a. m (a, w) -&gt; WriterT w m a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-var">StrictW.WriterT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (b, w) -&gt; WriterT w m b) -&gt; m (b, w) -&gt; WriterT w m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (b, w)) -&gt; m (b, w)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-var">uninterruptibleMask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (b, w)) -&gt; m (b, w))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (b, w)) -&gt; m (b, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053901"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053901"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">WriterT w m b -&gt; m (b, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#runWriterT"><span class="hs-identifier hs-var hs-var">StrictW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b
</span><a href="#local-6989586621679053902"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b)
-&gt; (forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
forall (m :: * -&gt; *) a w.
(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
</span><a href="#local-6989586621679053900"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; m (a, w)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053901"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-478"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679053897"><span id="local-6989586621679053898"><span id="local-6989586621679053899"><span class="annot"><a href="#local-6989586621679053900"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053899"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053898"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679053897"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053899"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053898"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679053897"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-type">StrictW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053897"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053899"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053898"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-type">StrictW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053897"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053899"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053898"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-479"></span><span>            </span><span id="local-6989586621679053900"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a w.
(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
</span><a href="#local-6989586621679053900"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053896"><span class="annot"><span class="annottext">m (a, w) -&gt; m (a, w)
</span><a href="#local-6989586621679053896"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679053895"><span class="annot"><span class="annottext">WriterT w m a
</span><a href="#local-6989586621679053895"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; WriterT w m a
forall w (m :: * -&gt; *) a. m (a, w) -&gt; WriterT w m a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-var">StrictW.WriterT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, w) -&gt; WriterT w m a) -&gt; m (a, w) -&gt; WriterT w m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; m (a, w)
</span><a href="#local-6989586621679053896"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WriterT w m a -&gt; m (a, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#runWriterT"><span class="hs-identifier hs-var hs-var">StrictW.runWriterT</span></a></span><span> </span><span class="annot"><span class="annottext">WriterT w m a
</span><a href="#local-6989586621679053895"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-480"></span><span>
</span><span id="line-481"></span><span>  </span><span id="local-6989586621679053879"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
WriterT w m a
-&gt; (a -&gt; ExitCase b -&gt; WriterT w m c)
-&gt; (a -&gt; WriterT w m b)
-&gt; WriterT w m (b, c)
</span><a href="#local-6989586621679053879"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679053878"><span class="annot"><span class="annottext">WriterT w m a
</span><a href="#local-6989586621679053878"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679053877"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; WriterT w m c
</span><a href="#local-6989586621679053877"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679053876"><span class="annot"><span class="annottext">a -&gt; WriterT w m b
</span><a href="#local-6989586621679053876"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m ((b, c), w) -&gt; WriterT w m (b, c)
forall w (m :: * -&gt; *) a. m (a, w) -&gt; WriterT w m a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#WriterT"><span class="hs-identifier hs-var">StrictW.WriterT</span></a></span><span> </span><span class="annot"><span class="annottext">(m ((b, c), w) -&gt; WriterT w m (b, c))
-&gt; m ((b, c), w) -&gt; WriterT w m (b, c)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-482"></span><span>    </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621679053875"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053875"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053874"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053874"><span class="hs-identifier hs-var">_w12</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679053873"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053873"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053872"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053872"><span class="hs-identifier hs-var">w123</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (a, w)
-&gt; ((a, w) -&gt; ExitCase (b, w) -&gt; m (c, w))
-&gt; ((a, w) -&gt; m (b, w))
-&gt; m ((b, w), (c, w))
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-483"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WriterT w m a -&gt; m (a, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#runWriterT"><span class="hs-identifier hs-var hs-var">StrictW.runWriterT</span></a></span><span> </span><span class="annot"><span class="annottext">WriterT w m a
</span><a href="#local-6989586621679053878"><span class="hs-identifier hs-var">acquire</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-484"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679053871"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053871"><span class="hs-identifier hs-var">resource</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053870"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053870"><span class="hs-identifier hs-var">w1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053869"><span class="annot"><span class="annottext">ExitCase (b, w)
</span><a href="#local-6989586621679053869"><span class="hs-identifier hs-var">exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ExitCase (b, w)
</span><a href="#local-6989586621679053869"><span class="hs-identifier hs-var">exitCase</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-485"></span><span>        </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-type">ExitCaseSuccess</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679053868"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053868"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053867"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053867"><span class="hs-identifier hs-var">w12</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-486"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621679053866"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053866"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053865"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053865"><span class="hs-identifier hs-var">w3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">WriterT w m c -&gt; m (c, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#runWriterT"><span class="hs-identifier hs-var hs-var">StrictW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; WriterT w m c
</span><a href="#local-6989586621679053877"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053871"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; ExitCase b
forall a. a -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-var">ExitCaseSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053868"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-487"></span><span>          </span><span class="annot"><span class="annottext">(c, w) -&gt; m (c, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053866"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053867"><span class="hs-identifier hs-var">w12</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053865"><span class="hs-identifier hs-var">w3</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-488"></span><span>        </span><span class="hs-comment">-- In the two other cases, the base monad overrides @use@'s state</span><span>
</span><span id="line-489"></span><span>        </span><span class="hs-comment">-- changes and the state reverts to @w1@.</span><span>
</span><span id="line-490"></span><span>        </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-type">ExitCaseException</span></a></span><span> </span><span id="local-6989586621679053864"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053864"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-491"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621679053863"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053863"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053862"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053862"><span class="hs-identifier hs-var">w3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">WriterT w m c -&gt; m (c, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#runWriterT"><span class="hs-identifier hs-var hs-var">StrictW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; WriterT w m c
</span><a href="#local-6989586621679053877"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053871"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; ExitCase b
forall a. SomeException -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-var">ExitCaseException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053864"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-492"></span><span>          </span><span class="annot"><span class="annottext">(c, w) -&gt; m (c, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053863"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053870"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053862"><span class="hs-identifier hs-var">w3</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-493"></span><span>        </span><span class="annot"><span class="annottext">ExitCase (b, w)
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-494"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621679053861"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053861"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053860"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053860"><span class="hs-identifier hs-var">w3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">WriterT w m c -&gt; m (c, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#runWriterT"><span class="hs-identifier hs-var hs-var">StrictW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; WriterT w m c
</span><a href="#local-6989586621679053877"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053871"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCase b
forall a. ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-495"></span><span>          </span><span class="annot"><span class="annottext">(c, w) -&gt; m (c, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053861"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053870"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053860"><span class="hs-identifier hs-var">w3</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-496"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679053859"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053859"><span class="hs-identifier hs-var">resource</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053858"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053858"><span class="hs-identifier hs-var">w1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-497"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679053857"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053857"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053856"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053856"><span class="hs-identifier hs-var">w2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">WriterT w m b -&gt; m (b, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Strict.html#runWriterT"><span class="hs-identifier hs-var hs-var">StrictW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; WriterT w m b
</span><a href="#local-6989586621679053876"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053859"><span class="hs-identifier hs-var">resource</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-498"></span><span>        </span><span class="annot"><span class="annottext">(b, w) -&gt; m (b, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053857"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053858"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053856"><span class="hs-identifier hs-var">w2</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-499"></span><span>    </span><span class="annot"><span class="annottext">((b, c), w) -&gt; m ((b, c), w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053875"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053873"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053872"><span class="hs-identifier hs-var">w123</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-500"></span><span>
</span><span id="line-501"></span><span id="local-6989586621679054913"><span id="local-6989586621679054914"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054914"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054913"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-type">LazyW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054913"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054914"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-502"></span><span>  </span><span id="local-6989586621679053841"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; WriterT w m a
</span><a href="#local-6989586621679053841"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span id="local-6989586621679053840"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053840"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; WriterT w m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; WriterT w m a) -&gt; m a -&gt; WriterT w m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053840"><span class="hs-identifier hs-var">e</span></a></span></span></span><span>
</span><span id="line-503"></span><span id="local-6989586621679054906"><span id="local-6989586621679054907"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054907"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054906"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-type">LazyW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054906"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054907"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-504"></span><span>  </span><span id="local-6989586621679053829"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
WriterT w m a -&gt; (e -&gt; WriterT w m a) -&gt; WriterT w m a
</span><a href="#local-6989586621679053829"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-type">LazyW.WriterT</span></a></span><span> </span><span id="local-6989586621679053827"><span class="annot"><span class="annottext">m (a, w)
</span><a href="#local-6989586621679053827"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053826"><span class="annot"><span class="annottext">e -&gt; WriterT w m a
</span><a href="#local-6989586621679053826"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; WriterT w m a
forall w (m :: * -&gt; *) a. m (a, w) -&gt; WriterT w m a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-var">LazyW.WriterT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, w) -&gt; WriterT w m a) -&gt; m (a, w) -&gt; WriterT w m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, w)
</span><a href="#local-6989586621679053827"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">`</span><span class="hs-identifier">catch</span><span> </span><span class="hs-special">`</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053825"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053825"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">WriterT w m a -&gt; m (a, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#runWriterT"><span class="hs-identifier hs-var hs-var">LazyW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; WriterT w m a
</span><a href="#local-6989586621679053826"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053825"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-505"></span><span id="local-6989586621679054894"><span id="local-6989586621679054895"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054895"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054894"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-type">LazyW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054894"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054895"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-506"></span><span>  </span><span id="local-6989586621679053811"><span class="annot"><span class="annottext">mask :: forall b.
((forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b)
-&gt; WriterT w m b
</span><a href="#local-6989586621679053811"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span id="local-6989586621679053810"><span class="annot"><span class="annottext">(forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b
</span><a href="#local-6989586621679053810"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (b, w) -&gt; WriterT w m b
forall w (m :: * -&gt; *) a. m (a, w) -&gt; WriterT w m a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-var">LazyW.WriterT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (b, w) -&gt; WriterT w m b) -&gt; m (b, w) -&gt; WriterT w m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (b, w)) -&gt; m (b, w)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (b, w)) -&gt; m (b, w))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (b, w)) -&gt; m (b, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053809"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053809"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">WriterT w m b -&gt; m (b, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#runWriterT"><span class="hs-identifier hs-var hs-var">LazyW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b
</span><a href="#local-6989586621679053810"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b)
-&gt; (forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
forall (m :: * -&gt; *) a w.
(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
</span><a href="#local-6989586621679053808"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; m (a, w)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053809"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-507"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679054889"><span id="local-6989586621679054890"><span id="local-6989586621679054891"><span class="annot"><a href="#local-6989586621679053808"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054891"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054890"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054889"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054891"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054890"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054889"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-type">LazyW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054889"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054891"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054890"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-type">LazyW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054889"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054891"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054890"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-508"></span><span>          </span><span id="local-6989586621679053808"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a w.
(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
</span><a href="#local-6989586621679053808"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053807"><span class="annot"><span class="annottext">m (a, w) -&gt; m (a, w)
</span><a href="#local-6989586621679053807"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679053806"><span class="annot"><span class="annottext">WriterT w m a
</span><a href="#local-6989586621679053806"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; WriterT w m a
forall w (m :: * -&gt; *) a. m (a, w) -&gt; WriterT w m a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-var">LazyW.WriterT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, w) -&gt; WriterT w m a) -&gt; m (a, w) -&gt; WriterT w m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; m (a, w)
</span><a href="#local-6989586621679053807"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WriterT w m a -&gt; m (a, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#runWriterT"><span class="hs-identifier hs-var hs-var">LazyW.runWriterT</span></a></span><span> </span><span class="annot"><span class="annottext">WriterT w m a
</span><a href="#local-6989586621679053806"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-509"></span><span>  </span><span id="local-6989586621679053804"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b.
((forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b)
-&gt; WriterT w m b
</span><a href="#local-6989586621679053804"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span id="local-6989586621679053803"><span class="annot"><span class="annottext">(forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b
</span><a href="#local-6989586621679053803"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-510"></span><span>    </span><span class="annot"><span class="annottext">m (b, w) -&gt; WriterT w m b
forall w (m :: * -&gt; *) a. m (a, w) -&gt; WriterT w m a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-var">LazyW.WriterT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (b, w) -&gt; WriterT w m b) -&gt; m (b, w) -&gt; WriterT w m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (b, w)) -&gt; m (b, w)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-var">uninterruptibleMask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (b, w)) -&gt; m (b, w))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (b, w)) -&gt; m (b, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053802"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053802"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">WriterT w m b -&gt; m (b, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#runWriterT"><span class="hs-identifier hs-var hs-var">LazyW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b
</span><a href="#local-6989586621679053803"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b)
-&gt; (forall a. WriterT w m a -&gt; WriterT w m a) -&gt; WriterT w m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
forall (m :: * -&gt; *) a w.
(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
</span><a href="#local-6989586621679053801"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; m (a, w)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053802"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-511"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679053798"><span id="local-6989586621679053799"><span id="local-6989586621679053800"><span class="annot"><a href="#local-6989586621679053801"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053800"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053799"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679053798"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053800"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053799"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679053798"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-type">LazyW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053798"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053800"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053799"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-type">LazyW.WriterT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053798"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053800"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053799"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-512"></span><span>            </span><span id="local-6989586621679053801"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a w.
(m (a, w) -&gt; m (a, w)) -&gt; WriterT w m a -&gt; WriterT w m a
</span><a href="#local-6989586621679053801"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053797"><span class="annot"><span class="annottext">m (a, w) -&gt; m (a, w)
</span><a href="#local-6989586621679053797"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span id="local-6989586621679053796"><span class="annot"><span class="annottext">WriterT w m a
</span><a href="#local-6989586621679053796"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; WriterT w m a
forall w (m :: * -&gt; *) a. m (a, w) -&gt; WriterT w m a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-var">LazyW.WriterT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, w) -&gt; WriterT w m a) -&gt; m (a, w) -&gt; WriterT w m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, w) -&gt; m (a, w)
</span><a href="#local-6989586621679053797"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WriterT w m a -&gt; m (a, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#runWriterT"><span class="hs-identifier hs-var hs-var">LazyW.runWriterT</span></a></span><span> </span><span class="annot"><span class="annottext">WriterT w m a
</span><a href="#local-6989586621679053796"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-513"></span><span>
</span><span id="line-514"></span><span>  </span><span id="local-6989586621679053780"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
WriterT w m a
-&gt; (a -&gt; ExitCase b -&gt; WriterT w m c)
-&gt; (a -&gt; WriterT w m b)
-&gt; WriterT w m (b, c)
</span><a href="#local-6989586621679053780"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679053779"><span class="annot"><span class="annottext">WriterT w m a
</span><a href="#local-6989586621679053779"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679053778"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; WriterT w m c
</span><a href="#local-6989586621679053778"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679053777"><span class="annot"><span class="annottext">a -&gt; WriterT w m b
</span><a href="#local-6989586621679053777"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m ((b, c), w) -&gt; WriterT w m (b, c)
forall w (m :: * -&gt; *) a. m (a, w) -&gt; WriterT w m a
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#WriterT"><span class="hs-identifier hs-var">LazyW.WriterT</span></a></span><span> </span><span class="annot"><span class="annottext">(m ((b, c), w) -&gt; WriterT w m (b, c))
-&gt; m ((b, c), w) -&gt; WriterT w m (b, c)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-515"></span><span>    </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621679053776"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053776"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053775"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053775"><span class="hs-identifier hs-var">_w12</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679053774"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053774"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053773"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053773"><span class="hs-identifier hs-var">w123</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (a, w)
-&gt; ((a, w) -&gt; ExitCase (b, w) -&gt; m (c, w))
-&gt; ((a, w) -&gt; m (b, w))
-&gt; m ((b, w), (c, w))
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-516"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WriterT w m a -&gt; m (a, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#runWriterT"><span class="hs-identifier hs-var hs-var">LazyW.runWriterT</span></a></span><span> </span><span class="annot"><span class="annottext">WriterT w m a
</span><a href="#local-6989586621679053779"><span class="hs-identifier hs-var">acquire</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-517"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679053772"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053772"><span class="hs-identifier hs-var">resource</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053771"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053771"><span class="hs-identifier hs-var">w1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053770"><span class="annot"><span class="annottext">ExitCase (b, w)
</span><a href="#local-6989586621679053770"><span class="hs-identifier hs-var">exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ExitCase (b, w)
</span><a href="#local-6989586621679053770"><span class="hs-identifier hs-var">exitCase</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-518"></span><span>        </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-type">ExitCaseSuccess</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679053769"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053769"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053768"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053768"><span class="hs-identifier hs-var">w12</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-519"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621679053767"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053767"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053766"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053766"><span class="hs-identifier hs-var">w3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">WriterT w m c -&gt; m (c, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#runWriterT"><span class="hs-identifier hs-var hs-var">LazyW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; WriterT w m c
</span><a href="#local-6989586621679053778"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053772"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; ExitCase b
forall a. a -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-var">ExitCaseSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053769"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-520"></span><span>          </span><span class="annot"><span class="annottext">(c, w) -&gt; m (c, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053767"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053768"><span class="hs-identifier hs-var">w12</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053766"><span class="hs-identifier hs-var">w3</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-521"></span><span>        </span><span class="hs-comment">-- In the two other cases, the base monad overrides @use@'s state</span><span>
</span><span id="line-522"></span><span>        </span><span class="hs-comment">-- changes and the state reverts to @w1@.</span><span>
</span><span id="line-523"></span><span>        </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-type">ExitCaseException</span></a></span><span> </span><span id="local-6989586621679053765"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053765"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-524"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621679053764"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053764"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053763"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053763"><span class="hs-identifier hs-var">w3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">WriterT w m c -&gt; m (c, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#runWriterT"><span class="hs-identifier hs-var hs-var">LazyW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; WriterT w m c
</span><a href="#local-6989586621679053778"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053772"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; ExitCase b
forall a. SomeException -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-var">ExitCaseException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053765"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-525"></span><span>          </span><span class="annot"><span class="annottext">(c, w) -&gt; m (c, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053764"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053771"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053763"><span class="hs-identifier hs-var">w3</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-526"></span><span>        </span><span class="annot"><span class="annottext">ExitCase (b, w)
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-527"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621679053762"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053762"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053761"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053761"><span class="hs-identifier hs-var">w3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">WriterT w m c -&gt; m (c, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#runWriterT"><span class="hs-identifier hs-var hs-var">LazyW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; WriterT w m c
</span><a href="#local-6989586621679053778"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053772"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCase b
forall a. ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-528"></span><span>          </span><span class="annot"><span class="annottext">(c, w) -&gt; m (c, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053762"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053771"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053761"><span class="hs-identifier hs-var">w3</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-529"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679053760"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053760"><span class="hs-identifier hs-var">resource</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053759"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053759"><span class="hs-identifier hs-var">w1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-530"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679053758"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053758"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053757"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053757"><span class="hs-identifier hs-var">w2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">WriterT w m b -&gt; m (b, w)
forall w (m :: * -&gt; *) a. WriterT w m a -&gt; m (a, w)
</span><a href="../../transformers/src/Control.Monad.Trans.Writer.Lazy.html#runWriterT"><span class="hs-identifier hs-var hs-var">LazyW.runWriterT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; WriterT w m b
</span><a href="#local-6989586621679053777"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053760"><span class="hs-identifier hs-var">resource</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-531"></span><span>        </span><span class="annot"><span class="annottext">(b, w) -&gt; m (b, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053758"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053759"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053757"><span class="hs-identifier hs-var">w2</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-532"></span><span>    </span><span class="annot"><span class="annottext">((b, c), w) -&gt; m ((b, c), w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053776"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053774"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053773"><span class="hs-identifier hs-var">w123</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-533"></span><span>
</span><span id="line-534"></span><span id="local-6989586621679054865"><span id="local-6989586621679054866"><span id="local-6989586621679054867"><span id="local-6989586621679054868"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054868"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054867"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054866"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054867"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054865"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054868"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-535"></span><span>  </span><span id="local-6989586621679053742"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; RWST r w s m a
</span><a href="#local-6989586621679053742"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span id="local-6989586621679053741"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053741"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; RWST r w s m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; RWST r w s m a) -&gt; m a -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053741"><span class="hs-identifier hs-var">e</span></a></span></span></span></span></span><span>
</span><span id="line-536"></span><span id="local-6989586621679054852"><span id="local-6989586621679054853"><span id="local-6989586621679054854"><span id="local-6989586621679054855"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054855"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054854"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054853"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054854"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054852"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054855"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-537"></span><span>  </span><span id="local-6989586621679053730"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
RWST r w s m a -&gt; (e -&gt; RWST r w s m a) -&gt; RWST r w s m a
</span><a href="#local-6989586621679053730"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">LazyRWS.RWST</span></a></span><span> </span><span id="local-6989586621679053728"><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679053728"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053727"><span class="annot"><span class="annottext">e -&gt; RWST r w s m a
</span><a href="#local-6989586621679053727"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053726"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053726"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679053725"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053725"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679053728"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053726"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053725"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; (e -&gt; m (a, s, w)) -&gt; m (a, s, w)
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-operator hs-var">`catch`</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053724"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053724"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">LazyRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; RWST r w s m a
</span><a href="#local-6989586621679053727"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053724"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053726"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053725"><span class="hs-identifier hs-var">s</span></a></span></span></span></span></span><span>
</span><span id="line-538"></span><span id="local-6989586621679054832"><span id="local-6989586621679054833"><span id="local-6989586621679054834"><span id="local-6989586621679054835"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054835"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054834"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054833"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054834"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054832"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054835"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-539"></span><span>  </span><span id="local-6989586621679053710"><span class="annot"><span class="annottext">mask :: forall b.
((forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b)
-&gt; RWST r w s m b
</span><a href="#local-6989586621679053710"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span id="local-6989586621679053709"><span class="annot"><span class="annottext">(forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b
</span><a href="#local-6989586621679053709"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b)
-&gt; (r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053708"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053708"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679053707"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053707"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (b, s, w)) -&gt; m (b, s, w)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (b, s, w)) -&gt; m (b, s, w))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (b, s, w)) -&gt; m (b, s, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053706"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053706"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RWST r w s m b -&gt; r -&gt; s -&gt; m (b, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">LazyRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b
</span><a href="#local-6989586621679053709"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b)
-&gt; (forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, s, w) -&gt; m (a, s, w)) -&gt; RWST r w s m a -&gt; RWST r w s m a
forall (m :: * -&gt; *) a s w r.
(m (a, s, w) -&gt; m (a, s, w)) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="#local-6989586621679053705"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053706"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053708"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053707"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-540"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679054825"><span id="local-6989586621679054826"><span id="local-6989586621679054827"><span id="local-6989586621679054828"><span id="local-6989586621679054829"><span class="annot"><a href="#local-6989586621679053705"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054829"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054828"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054827"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054826"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054829"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054828"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054827"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054826"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054825"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054826"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054827"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054829"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054828"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054825"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054826"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054827"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054829"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054828"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-541"></span><span>          </span><span id="local-6989586621679053705"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a s w r.
(m (a, s, w) -&gt; m (a, s, w)) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="#local-6989586621679053705"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053704"><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w)
</span><a href="#local-6989586621679053704"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">LazyRWS.RWST</span></a></span><span> </span><span id="local-6989586621679053703"><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679053703"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679053702"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053702"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679053701"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053701"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w)
</span><a href="#local-6989586621679053704"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679053703"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053702"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053701"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-542"></span><span>  </span><span id="local-6989586621679053699"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b.
((forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b)
-&gt; RWST r w s m b
</span><a href="#local-6989586621679053699"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span id="local-6989586621679053698"><span class="annot"><span class="annottext">(forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b
</span><a href="#local-6989586621679053698"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-543"></span><span>    </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b)
-&gt; (r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053697"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053697"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679053696"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053696"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (b, s, w)) -&gt; m (b, s, w)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-var">uninterruptibleMask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (b, s, w)) -&gt; m (b, s, w))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (b, s, w)) -&gt; m (b, s, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053695"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053695"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RWST r w s m b -&gt; r -&gt; s -&gt; m (b, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">LazyRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b
</span><a href="#local-6989586621679053698"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b)
-&gt; (forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, s, w) -&gt; m (a, s, w)) -&gt; RWST r w s m a -&gt; RWST r w s m a
forall (m :: * -&gt; *) a s w r.
(m (a, s, w) -&gt; m (a, s, w)) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="#local-6989586621679053694"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053695"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053697"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053696"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-544"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679053689"><span id="local-6989586621679053690"><span id="local-6989586621679053691"><span id="local-6989586621679053692"><span id="local-6989586621679053693"><span class="annot"><a href="#local-6989586621679053694"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053693"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053692"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679053691"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679053690"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053693"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053692"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679053691"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679053690"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053689"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053690"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053691"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053693"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053692"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053689"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053690"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053691"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053693"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053692"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-545"></span><span>            </span><span id="local-6989586621679053694"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a s w r.
(m (a, s, w) -&gt; m (a, s, w)) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="#local-6989586621679053694"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053688"><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w)
</span><a href="#local-6989586621679053688"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-type">LazyRWS.RWST</span></a></span><span> </span><span id="local-6989586621679053687"><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679053687"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679053686"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053686"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679053685"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053685"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w)
</span><a href="#local-6989586621679053688"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679053687"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053686"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053685"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-546"></span><span>
</span><span id="line-547"></span><span>  </span><span id="local-6989586621679053669"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
RWST r w s m a
-&gt; (a -&gt; ExitCase b -&gt; RWST r w s m c)
-&gt; (a -&gt; RWST r w s m b)
-&gt; RWST r w s m (b, c)
</span><a href="#local-6989586621679053669"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679053668"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679053668"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679053667"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; RWST r w s m c
</span><a href="#local-6989586621679053667"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679053666"><span class="annot"><span class="annottext">a -&gt; RWST r w s m b
</span><a href="#local-6989586621679053666"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m ((b, c), s, w)) -&gt; RWST r w s m (b, c)
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#RWST"><span class="hs-identifier hs-var">LazyRWS.RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m ((b, c), s, w)) -&gt; RWST r w s m (b, c))
-&gt; (r -&gt; s -&gt; m ((b, c), s, w)) -&gt; RWST r w s m (b, c)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053665"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053665"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679053664"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053664"><span class="hs-identifier hs-var">s0</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-548"></span><span>    </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621679053663"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053663"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053662"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053662"><span class="hs-identifier hs-var">_s2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053661"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053661"><span class="hs-identifier hs-var">_w12</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679053660"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053660"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053659"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053659"><span class="hs-identifier hs-var">s3</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053658"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053658"><span class="hs-identifier hs-var">w123</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (a, s, w)
-&gt; ((a, s, w) -&gt; ExitCase (b, s, w) -&gt; m (c, s, w))
-&gt; ((a, s, w) -&gt; m (b, s, w))
-&gt; m ((b, s, w), (c, s, w))
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-549"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">LazyRWS.runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679053668"><span class="hs-identifier hs-var">acquire</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053665"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053664"><span class="hs-identifier hs-var">s0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-550"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679053657"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053657"><span class="hs-identifier hs-var">resource</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053656"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053656"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053655"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053655"><span class="hs-identifier hs-var">w1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053654"><span class="annot"><span class="annottext">ExitCase (b, s, w)
</span><a href="#local-6989586621679053654"><span class="hs-identifier hs-var">exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ExitCase (b, s, w)
</span><a href="#local-6989586621679053654"><span class="hs-identifier hs-var">exitCase</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-551"></span><span>        </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-type">ExitCaseSuccess</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679053653"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053653"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053652"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053652"><span class="hs-identifier hs-var">s2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053651"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053651"><span class="hs-identifier hs-var">w12</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-552"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621679053650"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053650"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053649"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053649"><span class="hs-identifier hs-var">s3</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053648"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053648"><span class="hs-identifier hs-var">w3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m c -&gt; r -&gt; s -&gt; m (c, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">LazyRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; RWST r w s m c
</span><a href="#local-6989586621679053667"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053657"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; ExitCase b
forall a. a -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-var">ExitCaseSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053653"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053665"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053652"><span class="hs-identifier hs-var">s2</span></a></span><span>
</span><span id="line-553"></span><span>          </span><span class="annot"><span class="annottext">(c, s, w) -&gt; m (c, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053650"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053649"><span class="hs-identifier hs-var">s3</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053651"><span class="hs-identifier hs-var">w12</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053648"><span class="hs-identifier hs-var">w3</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-554"></span><span>        </span><span class="hs-comment">-- In the two other cases, the base monad overrides @use@'s state</span><span>
</span><span id="line-555"></span><span>        </span><span class="hs-comment">-- changes and the state reverts to @s1@ and @w1@.</span><span>
</span><span id="line-556"></span><span>        </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-type">ExitCaseException</span></a></span><span> </span><span id="local-6989586621679053647"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053647"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-557"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621679053646"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053646"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053645"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053645"><span class="hs-identifier hs-var">s3</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053644"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053644"><span class="hs-identifier hs-var">w3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m c -&gt; r -&gt; s -&gt; m (c, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">LazyRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; RWST r w s m c
</span><a href="#local-6989586621679053667"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053657"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; ExitCase b
forall a. SomeException -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-var">ExitCaseException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053647"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053665"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053656"><span class="hs-identifier hs-var">s1</span></a></span><span>
</span><span id="line-558"></span><span>          </span><span class="annot"><span class="annottext">(c, s, w) -&gt; m (c, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053646"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053645"><span class="hs-identifier hs-var">s3</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053655"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053644"><span class="hs-identifier hs-var">w3</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-559"></span><span>        </span><span class="annot"><span class="annottext">ExitCase (b, s, w)
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-560"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621679053643"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053643"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053642"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053642"><span class="hs-identifier hs-var">s3</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053641"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053641"><span class="hs-identifier hs-var">w3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m c -&gt; r -&gt; s -&gt; m (c, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">LazyRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; RWST r w s m c
</span><a href="#local-6989586621679053667"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053657"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCase b
forall a. ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053665"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053656"><span class="hs-identifier hs-var">s1</span></a></span><span>
</span><span id="line-561"></span><span>          </span><span class="annot"><span class="annottext">(c, s, w) -&gt; m (c, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053643"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053642"><span class="hs-identifier hs-var">s3</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053655"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053641"><span class="hs-identifier hs-var">w3</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-562"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679053640"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053640"><span class="hs-identifier hs-var">resource</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053639"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053639"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053638"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053638"><span class="hs-identifier hs-var">w1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-563"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679053637"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053637"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053636"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053636"><span class="hs-identifier hs-var">s2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053635"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053635"><span class="hs-identifier hs-var">w2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m b -&gt; r -&gt; s -&gt; m (b, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Lazy.html#runRWST"><span class="hs-identifier hs-var hs-var">LazyRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; RWST r w s m b
</span><a href="#local-6989586621679053666"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053640"><span class="hs-identifier hs-var">resource</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053665"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053639"><span class="hs-identifier hs-var">s1</span></a></span><span>
</span><span id="line-564"></span><span>        </span><span class="annot"><span class="annottext">(b, s, w) -&gt; m (b, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053637"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053636"><span class="hs-identifier hs-var">s2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053638"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053635"><span class="hs-identifier hs-var">w2</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-565"></span><span>    </span><span class="annot"><span class="annottext">((b, c), s, w) -&gt; m ((b, c), s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053663"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053660"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053659"><span class="hs-identifier hs-var">s3</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053658"><span class="hs-identifier hs-var">w123</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-566"></span><span>
</span><span id="line-567"></span><span id="local-6989586621679054797"><span id="local-6989586621679054798"><span id="local-6989586621679054799"><span id="local-6989586621679054800"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054800"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054799"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054798"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054799"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054797"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054800"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-568"></span><span>  </span><span id="local-6989586621679053620"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; RWST r w s m a
</span><a href="#local-6989586621679053620"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span id="local-6989586621679053619"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053619"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; RWST r w s m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; RWST r w s m a) -&gt; m a -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053619"><span class="hs-identifier hs-var">e</span></a></span></span></span></span></span><span>
</span><span id="line-569"></span><span id="local-6989586621679054784"><span id="local-6989586621679054785"><span id="local-6989586621679054786"><span id="local-6989586621679054787"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054787"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054786"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054785"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054786"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054784"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054787"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-570"></span><span>  </span><span id="local-6989586621679053608"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
RWST r w s m a -&gt; (e -&gt; RWST r w s m a) -&gt; RWST r w s m a
</span><a href="#local-6989586621679053608"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">StrictRWS.RWST</span></a></span><span> </span><span id="local-6989586621679053606"><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679053606"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053605"><span class="annot"><span class="annottext">e -&gt; RWST r w s m a
</span><a href="#local-6989586621679053605"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-var">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053604"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053604"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679053603"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053603"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679053606"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053604"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053603"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; (e -&gt; m (a, s, w)) -&gt; m (a, s, w)
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-operator hs-var">`catch`</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053602"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053602"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#runRWST"><span class="hs-identifier hs-var hs-var">StrictRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; RWST r w s m a
</span><a href="#local-6989586621679053605"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053602"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053604"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053603"><span class="hs-identifier hs-var">s</span></a></span></span></span></span></span><span>
</span><span id="line-571"></span><span id="local-6989586621679054764"><span id="local-6989586621679054765"><span id="local-6989586621679054766"><span id="local-6989586621679054767"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054767"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054766"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054765"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054766"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054764"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054767"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-572"></span><span>  </span><span id="local-6989586621679053588"><span class="annot"><span class="annottext">mask :: forall b.
((forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b)
-&gt; RWST r w s m b
</span><a href="#local-6989586621679053588"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span id="local-6989586621679053587"><span class="annot"><span class="annottext">(forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b
</span><a href="#local-6989586621679053587"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-var">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b)
-&gt; (r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053586"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053586"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679053585"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053585"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (b, s, w)) -&gt; m (b, s, w)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (b, s, w)) -&gt; m (b, s, w))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (b, s, w)) -&gt; m (b, s, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053584"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053584"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RWST r w s m b -&gt; r -&gt; s -&gt; m (b, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#runRWST"><span class="hs-identifier hs-var hs-var">StrictRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b
</span><a href="#local-6989586621679053587"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b)
-&gt; (forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, s, w) -&gt; m (a, s, w)) -&gt; RWST r w s m a -&gt; RWST r w s m a
forall (m :: * -&gt; *) a s w r.
(m (a, s, w) -&gt; m (a, s, w)) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="#local-6989586621679053583"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053584"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053586"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053585"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-573"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679054757"><span id="local-6989586621679054758"><span id="local-6989586621679054759"><span id="local-6989586621679054760"><span id="local-6989586621679054761"><span class="annot"><a href="#local-6989586621679053583"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054761"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054760"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054759"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054758"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054761"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054760"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054759"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679054758"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054757"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054758"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054759"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054761"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054760"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054757"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054758"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054759"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054761"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054760"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-574"></span><span>          </span><span id="local-6989586621679053583"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a s w r.
(m (a, s, w) -&gt; m (a, s, w)) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="#local-6989586621679053583"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053582"><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w)
</span><a href="#local-6989586621679053582"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">StrictRWS.RWST</span></a></span><span> </span><span id="local-6989586621679053581"><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679053581"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-var">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679053580"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053580"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679053579"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053579"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w)
</span><a href="#local-6989586621679053582"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679053581"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053580"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053579"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-575"></span><span>  </span><span id="local-6989586621679053577"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b.
((forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b)
-&gt; RWST r w s m b
</span><a href="#local-6989586621679053577"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span id="local-6989586621679053576"><span class="annot"><span class="annottext">(forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b
</span><a href="#local-6989586621679053576"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-576"></span><span>    </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-var">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b)
-&gt; (r -&gt; s -&gt; m (b, s, w)) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053575"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053575"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679053574"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053574"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (b, s, w)) -&gt; m (b, s, w)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-var">uninterruptibleMask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (b, s, w)) -&gt; m (b, s, w))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (b, s, w)) -&gt; m (b, s, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053573"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053573"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RWST r w s m b -&gt; r -&gt; s -&gt; m (b, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#runRWST"><span class="hs-identifier hs-var hs-var">StrictRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b
</span><a href="#local-6989586621679053576"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b)
-&gt; (forall a. RWST r w s m a -&gt; RWST r w s m a) -&gt; RWST r w s m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(m (a, s, w) -&gt; m (a, s, w)) -&gt; RWST r w s m a -&gt; RWST r w s m a
forall (m :: * -&gt; *) a s w r.
(m (a, s, w) -&gt; m (a, s, w)) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="#local-6989586621679053572"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053573"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053575"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053574"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-577"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679053567"><span id="local-6989586621679053568"><span id="local-6989586621679053569"><span id="local-6989586621679053570"><span id="local-6989586621679053571"><span class="annot"><a href="#local-6989586621679053572"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053571"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053570"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679053569"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679053568"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053571"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053570"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679053569"><span class="hs-identifier hs-type">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679053568"><span class="hs-identifier hs-type">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053567"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053568"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053569"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053571"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053570"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053567"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053568"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053569"><span class="hs-identifier hs-type">s</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053571"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053570"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span></span><span>
</span><span id="line-578"></span><span>            </span><span id="local-6989586621679053572"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a s w r.
(m (a, s, w) -&gt; m (a, s, w)) -&gt; RWST r w s m a -&gt; RWST r w s m a
</span><a href="#local-6989586621679053572"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053566"><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w)
</span><a href="#local-6989586621679053566"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-type">StrictRWS.RWST</span></a></span><span> </span><span id="local-6989586621679053565"><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679053565"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-var">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a)
-&gt; (r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679053564"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053564"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679053563"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053563"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m (a, s, w) -&gt; m (a, s, w)
</span><a href="#local-6989586621679053566"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">r -&gt; s -&gt; m (a, s, w)
</span><a href="#local-6989586621679053565"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053564"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053563"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-579"></span><span>
</span><span id="line-580"></span><span>  </span><span id="local-6989586621679053547"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
RWST r w s m a
-&gt; (a -&gt; ExitCase b -&gt; RWST r w s m c)
-&gt; (a -&gt; RWST r w s m b)
-&gt; RWST r w s m (b, c)
</span><a href="#local-6989586621679053547"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679053546"><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679053546"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679053545"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; RWST r w s m c
</span><a href="#local-6989586621679053545"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679053544"><span class="annot"><span class="annottext">a -&gt; RWST r w s m b
</span><a href="#local-6989586621679053544"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(r -&gt; s -&gt; m ((b, c), s, w)) -&gt; RWST r w s m (b, c)
forall r w s (m :: * -&gt; *) a.
(r -&gt; s -&gt; m (a, s, w)) -&gt; RWST r w s m a
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#RWST"><span class="hs-identifier hs-var">StrictRWS.RWST</span></a></span><span> </span><span class="annot"><span class="annottext">((r -&gt; s -&gt; m ((b, c), s, w)) -&gt; RWST r w s m (b, c))
-&gt; (r -&gt; s -&gt; m ((b, c), s, w)) -&gt; RWST r w s m (b, c)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053543"><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053543"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679053542"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053542"><span class="hs-identifier hs-var">s0</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-581"></span><span>    </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621679053541"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053541"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053540"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053540"><span class="hs-identifier hs-var">_s2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053539"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053539"><span class="hs-identifier hs-var">_w12</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679053538"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053538"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053537"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053537"><span class="hs-identifier hs-var">s3</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053536"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053536"><span class="hs-identifier hs-var">w123</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (a, s, w)
-&gt; ((a, s, w) -&gt; ExitCase (b, s, w) -&gt; m (c, s, w))
-&gt; ((a, s, w) -&gt; m (b, s, w))
-&gt; m ((b, s, w), (c, s, w))
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-582"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#runRWST"><span class="hs-identifier hs-var hs-var">StrictRWS.runRWST</span></a></span><span> </span><span class="annot"><span class="annottext">RWST r w s m a
</span><a href="#local-6989586621679053546"><span class="hs-identifier hs-var">acquire</span></a></span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053543"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053542"><span class="hs-identifier hs-var">s0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-583"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679053535"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053535"><span class="hs-identifier hs-var">resource</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053534"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053534"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053533"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053533"><span class="hs-identifier hs-var">w1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053532"><span class="annot"><span class="annottext">ExitCase (b, s, w)
</span><a href="#local-6989586621679053532"><span class="hs-identifier hs-var">exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ExitCase (b, s, w)
</span><a href="#local-6989586621679053532"><span class="hs-identifier hs-var">exitCase</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-584"></span><span>        </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-type">ExitCaseSuccess</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679053531"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053531"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053530"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053530"><span class="hs-identifier hs-var">s2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053529"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053529"><span class="hs-identifier hs-var">w12</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-585"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621679053528"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053528"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053527"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053527"><span class="hs-identifier hs-var">s3</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053526"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053526"><span class="hs-identifier hs-var">w3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m c -&gt; r -&gt; s -&gt; m (c, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#runRWST"><span class="hs-identifier hs-var hs-var">StrictRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; RWST r w s m c
</span><a href="#local-6989586621679053545"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053535"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; ExitCase b
forall a. a -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-var">ExitCaseSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053531"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053543"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053530"><span class="hs-identifier hs-var">s2</span></a></span><span>
</span><span id="line-586"></span><span>          </span><span class="annot"><span class="annottext">(c, s, w) -&gt; m (c, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053528"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053527"><span class="hs-identifier hs-var">s3</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053529"><span class="hs-identifier hs-var">w12</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053526"><span class="hs-identifier hs-var">w3</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-587"></span><span>        </span><span class="hs-comment">-- In the two other cases, the base monad overrides @use@'s state</span><span>
</span><span id="line-588"></span><span>        </span><span class="hs-comment">-- changes and the state reverts to @s1@ and @w1@.</span><span>
</span><span id="line-589"></span><span>        </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-type">ExitCaseException</span></a></span><span> </span><span id="local-6989586621679053525"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053525"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-590"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621679053524"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053524"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053523"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053523"><span class="hs-identifier hs-var">s3</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053522"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053522"><span class="hs-identifier hs-var">w3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m c -&gt; r -&gt; s -&gt; m (c, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#runRWST"><span class="hs-identifier hs-var hs-var">StrictRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; RWST r w s m c
</span><a href="#local-6989586621679053545"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053535"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; ExitCase b
forall a. SomeException -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-var">ExitCaseException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053525"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053543"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053534"><span class="hs-identifier hs-var">s1</span></a></span><span>
</span><span id="line-591"></span><span>          </span><span class="annot"><span class="annottext">(c, s, w) -&gt; m (c, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053524"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053523"><span class="hs-identifier hs-var">s3</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053533"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053522"><span class="hs-identifier hs-var">w3</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-592"></span><span>        </span><span class="annot"><span class="annottext">ExitCase (b, s, w)
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-593"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621679053521"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053521"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053520"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053520"><span class="hs-identifier hs-var">s3</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053519"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053519"><span class="hs-identifier hs-var">w3</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m c -&gt; r -&gt; s -&gt; m (c, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#runRWST"><span class="hs-identifier hs-var hs-var">StrictRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; RWST r w s m c
</span><a href="#local-6989586621679053545"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053535"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCase b
forall a. ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053543"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053534"><span class="hs-identifier hs-var">s1</span></a></span><span>
</span><span id="line-594"></span><span>          </span><span class="annot"><span class="annottext">(c, s, w) -&gt; m (c, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053521"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053520"><span class="hs-identifier hs-var">s3</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053533"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053519"><span class="hs-identifier hs-var">w3</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-595"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621679053518"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053518"><span class="hs-identifier hs-var">resource</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053517"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053517"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053516"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053516"><span class="hs-identifier hs-var">w1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-596"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621679053515"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053515"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053514"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053514"><span class="hs-identifier hs-var">s2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053513"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053513"><span class="hs-identifier hs-var">w2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RWST r w s m b -&gt; r -&gt; s -&gt; m (b, s, w)
forall r w s (m :: * -&gt; *) a.
RWST r w s m a -&gt; r -&gt; s -&gt; m (a, s, w)
</span><a href="../../transformers/src/Control.Monad.Trans.RWS.Strict.html#runRWST"><span class="hs-identifier hs-var hs-var">StrictRWS.runRWST</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; RWST r w s m b
</span><a href="#local-6989586621679053544"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053518"><span class="hs-identifier hs-var">resource</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">r
</span><a href="#local-6989586621679053543"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053517"><span class="hs-identifier hs-var">s1</span></a></span><span>
</span><span id="line-597"></span><span>        </span><span class="annot"><span class="annottext">(b, s, w) -&gt; m (b, s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053515"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053514"><span class="hs-identifier hs-var">s2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w -&gt; w
forall a. Monoid a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var">mappend</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053516"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053513"><span class="hs-identifier hs-var">w2</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-598"></span><span>    </span><span class="annot"><span class="annottext">((b, c), s, w) -&gt; m ((b, c), s, w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053541"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053538"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679053537"><span class="hs-identifier hs-var">s3</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679053536"><span class="hs-identifier hs-var">w123</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-599"></span><span>
</span><span id="line-600"></span><span class="hs-comment">-- Transformers which are only instances of MonadThrow and MonadCatch, not MonadMask</span><span>
</span><span id="line-601"></span><span id="local-6989586621679054738"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054738"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.List.html#ListT"><span class="hs-identifier hs-type">ListT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054738"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-602"></span><span>  </span><span id="local-6989586621679053499"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; ListT m a
</span><a href="#local-6989586621679053499"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ListT m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ListT m a) -&gt; (e -&gt; m a) -&gt; e -&gt; ListT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span></span><span>
</span><span id="line-603"></span><span id="local-6989586621679054734"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054734"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.List.html#ListT"><span class="hs-identifier hs-type">ListT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054734"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-604"></span><span>  </span><span id="local-6989586621679053489"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
ListT m a -&gt; (e -&gt; ListT m a) -&gt; ListT m a
</span><a href="#local-6989586621679053489"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.List.html#ListT"><span class="hs-identifier hs-type">ListT</span></a></span><span> </span><span id="local-6989586621679053487"><span class="annot"><span class="annottext">m [a]
</span><a href="#local-6989586621679053487"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053486"><span class="annot"><span class="annottext">e -&gt; ListT m a
</span><a href="#local-6989586621679053486"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m [a] -&gt; ListT m a
forall (m :: * -&gt; *) a. m [a] -&gt; ListT m a
</span><a href="../../transformers/src/Control.Monad.Trans.List.html#ListT"><span class="hs-identifier hs-var">ListT</span></a></span><span> </span><span class="annot"><span class="annottext">(m [a] -&gt; ListT m a) -&gt; m [a] -&gt; ListT m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m [a] -&gt; (e -&gt; m [a]) -&gt; m [a]
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span> </span><span class="annot"><span class="annottext">m [a]
</span><a href="#local-6989586621679053487"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ListT m a -&gt; m [a]
forall (m :: * -&gt; *) a. ListT m a -&gt; m [a]
</span><a href="../../transformers/src/Control.Monad.Trans.List.html#runListT"><span class="hs-identifier hs-var hs-var">runListT</span></a></span><span> </span><span class="annot"><span class="annottext">(ListT m a -&gt; m [a]) -&gt; (e -&gt; ListT m a) -&gt; e -&gt; m [a]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; ListT m a
</span><a href="#local-6989586621679053486"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-605"></span><span>
</span><span id="line-606"></span><span class="hs-comment">-- | Throws exceptions into the base monad.</span><span>
</span><span id="line-607"></span><span id="local-6989586621679054724"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054724"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054724"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-608"></span><span>  </span><span id="local-6989586621679053472"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; MaybeT m a
</span><a href="#local-6989586621679053472"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; MaybeT m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; MaybeT m a) -&gt; (e -&gt; m a) -&gt; e -&gt; MaybeT m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span></span><span>
</span><span id="line-609"></span><span class="hs-comment">-- | Catches exceptions from the base monad.</span><span>
</span><span id="line-610"></span><span id="local-6989586621679054720"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054720"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054720"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-611"></span><span>  </span><span id="local-6989586621679053462"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
MaybeT m a -&gt; (e -&gt; MaybeT m a) -&gt; MaybeT m a
</span><a href="#local-6989586621679053462"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span id="local-6989586621679053460"><span class="annot"><span class="annottext">m (Maybe a)
</span><a href="#local-6989586621679053460"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053459"><span class="annot"><span class="annottext">e -&gt; MaybeT m a
</span><a href="#local-6989586621679053459"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Maybe a) -&gt; MaybeT m a
forall (m :: * -&gt; *) a. m (Maybe a) -&gt; MaybeT m a
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-var">MaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Maybe a) -&gt; MaybeT m a) -&gt; m (Maybe a) -&gt; MaybeT m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m (Maybe a) -&gt; (e -&gt; m (Maybe a)) -&gt; m (Maybe a)
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span> </span><span class="annot"><span class="annottext">m (Maybe a)
</span><a href="#local-6989586621679053460"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MaybeT m a -&gt; m (Maybe a)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(MaybeT m a -&gt; m (Maybe a))
-&gt; (e -&gt; MaybeT m a) -&gt; e -&gt; m (Maybe a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; MaybeT m a
</span><a href="#local-6989586621679053459"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-612"></span><span class="hs-comment">-- | @since 0.10.0</span><span>
</span><span id="line-613"></span><span id="local-6989586621679054712"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054712"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054712"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-614"></span><span>  </span><span id="local-6989586621679053447"><span class="annot"><span class="annottext">mask :: forall b.
((forall a. MaybeT m a -&gt; MaybeT m a) -&gt; MaybeT m b) -&gt; MaybeT m b
</span><a href="#local-6989586621679053447"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span id="local-6989586621679053446"><span class="annot"><span class="annottext">(forall a. MaybeT m a -&gt; MaybeT m a) -&gt; MaybeT m b
</span><a href="#local-6989586621679053446"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Maybe b) -&gt; MaybeT m b
forall (m :: * -&gt; *) a. m (Maybe a) -&gt; MaybeT m a
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-var">MaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Maybe b) -&gt; MaybeT m b) -&gt; m (Maybe b) -&gt; MaybeT m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (Maybe b)) -&gt; m (Maybe b)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (Maybe b)) -&gt; m (Maybe b))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (Maybe b)) -&gt; m (Maybe b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053445"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053445"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MaybeT m b -&gt; m (Maybe b)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(MaybeT m b -&gt; m (Maybe b)) -&gt; MaybeT m b -&gt; m (Maybe b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(forall a. MaybeT m a -&gt; MaybeT m a) -&gt; MaybeT m b
</span><a href="#local-6989586621679053446"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(m (Maybe a) -&gt; m (Maybe a)) -&gt; MaybeT m a -&gt; MaybeT m a
forall (m :: * -&gt; *) a.
(m (Maybe a) -&gt; m (Maybe a)) -&gt; MaybeT m a -&gt; MaybeT m a
</span><a href="#local-6989586621679053444"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (Maybe a) -&gt; m (Maybe a)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053445"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-615"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-616"></span><span>      </span><span id="local-6989586621679054708"><span id="local-6989586621679054709"><span class="annot"><a href="#local-6989586621679053444"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054709"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054708"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054709"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054708"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-617"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054709"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054708"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054709"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054708"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-618"></span><span>      </span><span id="local-6989586621679053444"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a.
(m (Maybe a) -&gt; m (Maybe a)) -&gt; MaybeT m a -&gt; MaybeT m a
</span><a href="#local-6989586621679053444"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053443"><span class="annot"><span class="annottext">m (Maybe a) -&gt; m (Maybe a)
</span><a href="#local-6989586621679053443"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span id="local-6989586621679053442"><span class="annot"><span class="annottext">m (Maybe a)
</span><a href="#local-6989586621679053442"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Maybe a) -&gt; MaybeT m a
forall (m :: * -&gt; *) a. m (Maybe a) -&gt; MaybeT m a
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-var">MaybeT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m (Maybe a) -&gt; m (Maybe a)
</span><a href="#local-6989586621679053443"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">m (Maybe a)
</span><a href="#local-6989586621679053442"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-619"></span><span>  </span><span id="local-6989586621679053440"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b.
((forall a. MaybeT m a -&gt; MaybeT m a) -&gt; MaybeT m b) -&gt; MaybeT m b
</span><a href="#local-6989586621679053440"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span id="local-6989586621679053439"><span class="annot"><span class="annottext">(forall a. MaybeT m a -&gt; MaybeT m a) -&gt; MaybeT m b
</span><a href="#local-6989586621679053439"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Maybe b) -&gt; MaybeT m b
forall (m :: * -&gt; *) a. m (Maybe a) -&gt; MaybeT m a
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-var">MaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Maybe b) -&gt; MaybeT m b) -&gt; m (Maybe b) -&gt; MaybeT m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (Maybe b)) -&gt; m (Maybe b)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-var">uninterruptibleMask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (Maybe b)) -&gt; m (Maybe b))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (Maybe b)) -&gt; m (Maybe b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053438"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053438"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MaybeT m b -&gt; m (Maybe b)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(MaybeT m b -&gt; m (Maybe b)) -&gt; MaybeT m b -&gt; m (Maybe b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(forall a. MaybeT m a -&gt; MaybeT m a) -&gt; MaybeT m b
</span><a href="#local-6989586621679053439"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(m (Maybe a) -&gt; m (Maybe a)) -&gt; MaybeT m a -&gt; MaybeT m a
forall (m :: * -&gt; *) a.
(m (Maybe a) -&gt; m (Maybe a)) -&gt; MaybeT m a -&gt; MaybeT m a
</span><a href="#local-6989586621679053437"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (Maybe a) -&gt; m (Maybe a)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053438"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-620"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-621"></span><span>      </span><span id="local-6989586621679053435"><span id="local-6989586621679053436"><span class="annot"><a href="#local-6989586621679053437"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053436"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053435"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053436"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053435"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-622"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053436"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053435"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053436"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053435"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-623"></span><span>      </span><span id="local-6989586621679053437"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) a.
(m (Maybe a) -&gt; m (Maybe a)) -&gt; MaybeT m a -&gt; MaybeT m a
</span><a href="#local-6989586621679053437"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053434"><span class="annot"><span class="annottext">m (Maybe a) -&gt; m (Maybe a)
</span><a href="#local-6989586621679053434"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-type">MaybeT</span></a></span><span> </span><span id="local-6989586621679053433"><span class="annot"><span class="annottext">m (Maybe a)
</span><a href="#local-6989586621679053433"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Maybe a) -&gt; MaybeT m a
forall (m :: * -&gt; *) a. m (Maybe a) -&gt; MaybeT m a
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-var">MaybeT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m (Maybe a) -&gt; m (Maybe a)
</span><a href="#local-6989586621679053434"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">m (Maybe a)
</span><a href="#local-6989586621679053433"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-624"></span><span>
</span><span id="line-625"></span><span>  </span><span id="local-6989586621679053423"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
MaybeT m a
-&gt; (a -&gt; ExitCase b -&gt; MaybeT m c)
-&gt; (a -&gt; MaybeT m b)
-&gt; MaybeT m (b, c)
</span><a href="#local-6989586621679053423"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679053422"><span class="annot"><span class="annottext">MaybeT m a
</span><a href="#local-6989586621679053422"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679053421"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; MaybeT m c
</span><a href="#local-6989586621679053421"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679053420"><span class="annot"><span class="annottext">a -&gt; MaybeT m b
</span><a href="#local-6989586621679053420"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Maybe (b, c)) -&gt; MaybeT m (b, c)
forall (m :: * -&gt; *) a. m (Maybe a) -&gt; MaybeT m a
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#MaybeT"><span class="hs-identifier hs-var">MaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Maybe (b, c)) -&gt; MaybeT m (b, c))
-&gt; m (Maybe (b, c)) -&gt; MaybeT m (b, c)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-626"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679053419"><span class="annot"><span class="annottext">Maybe b
</span><a href="#local-6989586621679053419"><span class="hs-identifier hs-var">eb</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053418"><span class="annot"><span class="annottext">Maybe c
</span><a href="#local-6989586621679053418"><span class="hs-identifier hs-var">ec</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (Maybe a)
-&gt; (Maybe a -&gt; ExitCase (Maybe b) -&gt; m (Maybe c))
-&gt; (Maybe a -&gt; m (Maybe b))
-&gt; m (Maybe b, Maybe c)
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-627"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MaybeT m a -&gt; m (Maybe a)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeT m a
</span><a href="#local-6989586621679053422"><span class="hs-identifier hs-var">acquire</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-628"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679053417"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679053417"><span class="hs-identifier hs-var">resourceMay</span></a></span></span><span> </span><span id="local-6989586621679053416"><span class="annot"><span class="annottext">ExitCase (Maybe b)
</span><a href="#local-6989586621679053416"><span class="hs-identifier hs-var">exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679053417"><span class="hs-identifier hs-var">resourceMay</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-629"></span><span>        </span><span class="annot"><span class="annottext">Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe c -&gt; m (Maybe c)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe c
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-comment">-- nothing to release, acquire didn't succeed</span><span>
</span><span id="line-630"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679053415"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053415"><span class="hs-identifier hs-var">resource</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ExitCase (Maybe b)
</span><a href="#local-6989586621679053416"><span class="hs-identifier hs-var">exitCase</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-631"></span><span>          </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-type">ExitCaseSuccess</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679053414"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053414"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MaybeT m c -&gt; m (Maybe c)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; MaybeT m c
</span><a href="#local-6989586621679053421"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053415"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; ExitCase b
forall a. a -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-var">ExitCaseSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053414"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-632"></span><span>          </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-type">ExitCaseException</span></a></span><span> </span><span id="local-6989586621679053413"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053413"><span class="hs-identifier hs-var">e</span></a></span></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MaybeT m c -&gt; m (Maybe c)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; MaybeT m c
</span><a href="#local-6989586621679053421"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053415"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; ExitCase b
forall a. SomeException -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-var">ExitCaseException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053413"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-633"></span><span>          </span><span class="annot"><span class="annottext">ExitCase (Maybe b)
</span><span class="hs-identifier">_</span></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MaybeT m c -&gt; m (Maybe c)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; MaybeT m c
</span><a href="#local-6989586621679053421"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053415"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCase b
forall a. ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-634"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679053412"><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679053412"><span class="hs-identifier hs-var">resourceMay</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe a
</span><a href="#local-6989586621679053412"><span class="hs-identifier hs-var">resourceMay</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-635"></span><span>        </span><span class="annot"><span class="annottext">Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe b -&gt; m (Maybe b)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe b
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-636"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679053411"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053411"><span class="hs-identifier hs-var">resource</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MaybeT m b -&gt; m (Maybe b)
forall (m :: * -&gt; *) a. MaybeT m a -&gt; m (Maybe a)
</span><a href="../../transformers/src/Control.Monad.Trans.Maybe.html#runMaybeT"><span class="hs-identifier hs-var hs-var">runMaybeT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; MaybeT m b
</span><a href="#local-6989586621679053420"><span class="hs-identifier hs-var">use</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053411"><span class="hs-identifier hs-var">resource</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-637"></span><span>    </span><span class="hs-comment">-- The order in which we perform those two 'Maybe' effects doesn't matter,</span><span>
</span><span id="line-638"></span><span>    </span><span class="hs-comment">-- since the error message is the same regardless.</span><span>
</span><span id="line-639"></span><span>    </span><span class="annot"><span class="annottext">Maybe (b, c) -&gt; m (Maybe (b, c))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(b -&gt; c -&gt; (b, c)) -&gt; Maybe b -&gt; Maybe (c -&gt; (b, c))
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe b
</span><a href="#local-6989586621679053419"><span class="hs-identifier hs-var">eb</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (c -&gt; (b, c)) -&gt; Maybe c -&gt; Maybe (b, c)
forall (f :: * -&gt; *) a b. Applicative f =&gt; f (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var">&lt;*&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe c
</span><a href="#local-6989586621679053418"><span class="hs-identifier hs-var">ec</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-640"></span><span>
</span><span id="line-641"></span><span class="hs-comment">-- | Throws exceptions into the base monad.</span><span>
</span><span id="line-642"></span><span id="local-6989586621679054684"><span id="local-6989586621679054685"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054685"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054684"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054685"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054684"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-643"></span><span>  </span><span id="local-6989586621679053395"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; ErrorT e m a
</span><a href="#local-6989586621679053395"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ErrorT e m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ErrorT e m a) -&gt; (e -&gt; m a) -&gt; e -&gt; ErrorT e m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span></span></span><span>
</span><span id="line-644"></span><span class="hs-comment">-- | Catches exceptions from the base monad.</span><span>
</span><span id="line-645"></span><span id="local-6989586621679054677"><span id="local-6989586621679054678"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054678"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054677"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054678"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054677"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-646"></span><span>  </span><span id="local-6989586621679053384"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
ErrorT e m a -&gt; (e -&gt; ErrorT e m a) -&gt; ErrorT e m a
</span><a href="#local-6989586621679053384"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span id="local-6989586621679053382"><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679053382"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053381"><span class="annot"><span class="annottext">e -&gt; ErrorT e m a
</span><a href="#local-6989586621679053381"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; ErrorT e m a) -&gt; m (Either e a) -&gt; ErrorT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; (e -&gt; m (Either e a)) -&gt; m (Either e a)
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679053382"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(ErrorT e m a -&gt; m (Either e a))
-&gt; (e -&gt; ErrorT e m a) -&gt; e -&gt; m (Either e a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; ErrorT e m a
</span><a href="#local-6989586621679053381"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-647"></span><span id="local-6989586621679054665"><span id="local-6989586621679054666"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054666"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054665"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054666"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054665"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-648"></span><span>  </span><span id="local-6989586621679053368"><span class="annot"><span class="annottext">mask :: forall b.
((forall a. ErrorT e m a -&gt; ErrorT e m a) -&gt; ErrorT e m b)
-&gt; ErrorT e m b
</span><a href="#local-6989586621679053368"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span id="local-6989586621679053367"><span class="annot"><span class="annottext">(forall a. ErrorT e m a -&gt; ErrorT e m a) -&gt; ErrorT e m b
</span><a href="#local-6989586621679053367"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e b) -&gt; ErrorT e m b
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e b) -&gt; ErrorT e m b) -&gt; m (Either e b) -&gt; ErrorT e m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (Either e b)) -&gt; m (Either e b)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (Either e b)) -&gt; m (Either e b))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (Either e b)) -&gt; m (Either e b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053366"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053366"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrorT e m b -&gt; m (Either e b)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(ErrorT e m b -&gt; m (Either e b)) -&gt; ErrorT e m b -&gt; m (Either e b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(forall a. ErrorT e m a -&gt; ErrorT e m a) -&gt; ErrorT e m b
</span><a href="#local-6989586621679053367"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(m (Either e a) -&gt; m (Either e a)) -&gt; ErrorT e m a -&gt; ErrorT e m a
forall (m :: * -&gt; *) e a.
(m (Either e a) -&gt; m (Either e a)) -&gt; ErrorT e m a -&gt; ErrorT e m a
</span><a href="#local-6989586621679053365"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; m (Either e a)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053366"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-649"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-650"></span><span>      </span><span id="local-6989586621679054660"><span id="local-6989586621679054661"><span id="local-6989586621679054662"><span class="annot"><a href="#local-6989586621679053365"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054662"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054661"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054660"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054662"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054661"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054660"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-651"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054661"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054662"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054660"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054661"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054662"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054660"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-652"></span><span>      </span><span id="local-6989586621679053365"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) e a.
(m (Either e a) -&gt; m (Either e a)) -&gt; ErrorT e m a -&gt; ErrorT e m a
</span><a href="#local-6989586621679053365"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053364"><span class="annot"><span class="annottext">m (Either e a) -&gt; m (Either e a)
</span><a href="#local-6989586621679053364"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span id="local-6989586621679053363"><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679053363"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m (Either e a) -&gt; m (Either e a)
</span><a href="#local-6989586621679053364"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679053363"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-653"></span><span>  </span><span id="local-6989586621679053361"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b.
((forall a. ErrorT e m a -&gt; ErrorT e m a) -&gt; ErrorT e m b)
-&gt; ErrorT e m b
</span><a href="#local-6989586621679053361"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span id="local-6989586621679053360"><span class="annot"><span class="annottext">(forall a. ErrorT e m a -&gt; ErrorT e m a) -&gt; ErrorT e m b
</span><a href="#local-6989586621679053360"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e b) -&gt; ErrorT e m b
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e b) -&gt; ErrorT e m b) -&gt; m (Either e b) -&gt; ErrorT e m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (Either e b)) -&gt; m (Either e b)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-var">uninterruptibleMask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (Either e b)) -&gt; m (Either e b))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (Either e b)) -&gt; m (Either e b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053359"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053359"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrorT e m b -&gt; m (Either e b)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(ErrorT e m b -&gt; m (Either e b)) -&gt; ErrorT e m b -&gt; m (Either e b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(forall a. ErrorT e m a -&gt; ErrorT e m a) -&gt; ErrorT e m b
</span><a href="#local-6989586621679053360"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(m (Either e a) -&gt; m (Either e a)) -&gt; ErrorT e m a -&gt; ErrorT e m a
forall (m :: * -&gt; *) e a.
(m (Either e a) -&gt; m (Either e a)) -&gt; ErrorT e m a -&gt; ErrorT e m a
</span><a href="#local-6989586621679053358"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; m (Either e a)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053359"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-654"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-655"></span><span>      </span><span id="local-6989586621679053355"><span id="local-6989586621679053356"><span id="local-6989586621679053357"><span class="annot"><a href="#local-6989586621679053358"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053357"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053356"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053355"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053357"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053356"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053355"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-656"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053356"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053357"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053355"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053356"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053357"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053355"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-657"></span><span>      </span><span id="local-6989586621679053358"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) e a.
(m (Either e a) -&gt; m (Either e a)) -&gt; ErrorT e m a -&gt; ErrorT e m a
</span><a href="#local-6989586621679053358"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053354"><span class="annot"><span class="annottext">m (Either e a) -&gt; m (Either e a)
</span><a href="#local-6989586621679053354"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span id="local-6989586621679053353"><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679053353"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m (Either e a) -&gt; m (Either e a)
</span><a href="#local-6989586621679053354"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679053353"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-658"></span><span>
</span><span id="line-659"></span><span>  </span><span id="local-6989586621679053344"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
ErrorT e m a
-&gt; (a -&gt; ExitCase b -&gt; ErrorT e m c)
-&gt; (a -&gt; ErrorT e m b)
-&gt; ErrorT e m (b, c)
</span><a href="#local-6989586621679053344"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679053343"><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679053343"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679053342"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; ErrorT e m c
</span><a href="#local-6989586621679053342"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679053341"><span class="annot"><span class="annottext">a -&gt; ErrorT e m b
</span><a href="#local-6989586621679053341"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e (b, c)) -&gt; ErrorT e m (b, c)
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e (b, c)) -&gt; ErrorT e m (b, c))
-&gt; m (Either e (b, c)) -&gt; ErrorT e m (b, c)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-660"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679053340"><span class="annot"><span class="annottext">Either e b
</span><a href="#local-6989586621679053340"><span class="hs-identifier hs-var">eb</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053339"><span class="annot"><span class="annottext">Either e c
</span><a href="#local-6989586621679053339"><span class="hs-identifier hs-var">ec</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (Either e a)
-&gt; (Either e a -&gt; ExitCase (Either e b) -&gt; m (Either e c))
-&gt; (Either e a -&gt; m (Either e b))
-&gt; m (Either e b, Either e c)
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-661"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679053343"><span class="hs-identifier hs-var">acquire</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-662"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679053338"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679053338"><span class="hs-identifier hs-var">eresource</span></a></span></span><span> </span><span id="local-6989586621679053337"><span class="annot"><span class="annottext">ExitCase (Either e b)
</span><a href="#local-6989586621679053337"><span class="hs-identifier hs-var">exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679053338"><span class="hs-identifier hs-var">eresource</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-663"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679053336"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053336"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either e c -&gt; m (Either e c)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; Either e c
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053336"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- nothing to release, acquire didn't succeed</span><span>
</span><span id="line-664"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679053335"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053335"><span class="hs-identifier hs-var">resource</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ExitCase (Either e b)
</span><a href="#local-6989586621679053337"><span class="hs-identifier hs-var">exitCase</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-665"></span><span>          </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-type">ExitCaseSuccess</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679053334"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053334"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrorT e m c -&gt; m (Either e c)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; ErrorT e m c
</span><a href="#local-6989586621679053342"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053335"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; ExitCase b
forall a. a -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-var">ExitCaseSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053334"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-666"></span><span>          </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-type">ExitCaseException</span></a></span><span> </span><span id="local-6989586621679053333"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053333"><span class="hs-identifier hs-var">e</span></a></span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrorT e m c -&gt; m (Either e c)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; ErrorT e m c
</span><a href="#local-6989586621679053342"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053335"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; ExitCase b
forall a. SomeException -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-var">ExitCaseException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053333"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-667"></span><span>          </span><span class="annot"><span class="annottext">ExitCase (Either e b)
</span><span class="hs-identifier">_</span></span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrorT e m c -&gt; m (Either e c)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; ErrorT e m c
</span><a href="#local-6989586621679053342"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053335"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCase b
forall a. ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-668"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(e -&gt; m (Either e b))
-&gt; (a -&gt; m (Either e b)) -&gt; Either e a -&gt; m (Either e b)
forall a c b. (a -&gt; c) -&gt; (b -&gt; c) -&gt; Either a b -&gt; c
</span><a href="../../base/src/Data.Either.html#either"><span class="hs-identifier hs-var">either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Either e b -&gt; m (Either e b)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either e b -&gt; m (Either e b))
-&gt; (e -&gt; Either e b) -&gt; e -&gt; m (Either e b)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e b
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ErrorT e m b -&gt; m (Either e b)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(ErrorT e m b -&gt; m (Either e b))
-&gt; (a -&gt; ErrorT e m b) -&gt; a -&gt; m (Either e b)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ErrorT e m b
</span><a href="#local-6989586621679053341"><span class="hs-identifier hs-var">use</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-669"></span><span>    </span><span class="annot"><span class="annottext">Either e (b, c) -&gt; m (Either e (b, c))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either e (b, c) -&gt; m (Either e (b, c)))
-&gt; Either e (b, c) -&gt; m (Either e (b, c))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-670"></span><span>      </span><span class="hs-comment">-- The order in which we perform those two 'Either' effects determines</span><span>
</span><span id="line-671"></span><span>      </span><span class="hs-comment">-- which error will win if they are both 'Left's. We want the error from</span><span>
</span><span id="line-672"></span><span>      </span><span class="hs-comment">-- 'release' to win.</span><span>
</span><span id="line-673"></span><span>      </span><span id="local-6989586621679053331"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053331"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Either e c
</span><a href="#local-6989586621679053339"><span class="hs-identifier hs-var">ec</span></a></span><span>
</span><span id="line-674"></span><span>      </span><span id="local-6989586621679053330"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053330"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Either e b
</span><a href="#local-6989586621679053340"><span class="hs-identifier hs-var">eb</span></a></span><span>
</span><span id="line-675"></span><span>      </span><span class="annot"><span class="annottext">(b, c) -&gt; Either e (b, c)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053330"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053331"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-676"></span><span>
</span><span id="line-677"></span><span class="hs-comment">-- | Throws exceptions into the base monad.</span><span>
</span><span id="line-678"></span><span id="local-6989586621679054639"><span id="local-6989586621679054640"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054640"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-type">ExceptT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054639"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054640"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-679"></span><span>  </span><span id="local-6989586621679053316"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; ExceptT e m a
</span><a href="#local-6989586621679053316"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ExceptT e m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ExceptT e m a) -&gt; (e -&gt; m a) -&gt; e -&gt; ExceptT e m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span></span></span><span>
</span><span id="line-680"></span><span class="hs-comment">-- | Catches exceptions from the base monad.</span><span>
</span><span id="line-681"></span><span id="local-6989586621679054632"><span id="local-6989586621679054633"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054633"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-type">ExceptT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054632"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054633"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-682"></span><span>  </span><span id="local-6989586621679053306"><span class="annot"><span class="annottext">catch :: forall e a.
Exception e =&gt;
ExceptT e m a -&gt; (e -&gt; ExceptT e m a) -&gt; ExceptT e m a
</span><a href="#local-6989586621679053306"><span class="hs-identifier hs-var hs-var hs-var hs-var">catch</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-type">ExceptT</span></a></span><span> </span><span id="local-6989586621679053304"><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679053304"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053303"><span class="annot"><span class="annottext">e -&gt; ExceptT e m a
</span><a href="#local-6989586621679053303"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ExceptT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ExceptT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-var">ExceptT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; ExceptT e m a)
-&gt; m (Either e a) -&gt; ExceptT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; (e -&gt; m (Either e a)) -&gt; m (Either e a)
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679053304"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExceptT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ExceptT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#runExceptT"><span class="hs-identifier hs-var">runExceptT</span></a></span><span> </span><span class="annot"><span class="annottext">(ExceptT e m a -&gt; m (Either e a))
-&gt; (e -&gt; ExceptT e m a) -&gt; e -&gt; m (Either e a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; ExceptT e m a
</span><a href="#local-6989586621679053303"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-683"></span><span class="hs-comment">-- | @since 0.9.0</span><span>
</span><span id="line-684"></span><span id="local-6989586621679054620"><span id="local-6989586621679054621"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054621"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-type">ExceptT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054620"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054621"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-685"></span><span>  </span><span id="local-6989586621679053291"><span class="annot"><span class="annottext">mask :: forall b.
((forall a. ExceptT e m a -&gt; ExceptT e m a) -&gt; ExceptT e m b)
-&gt; ExceptT e m b
</span><a href="#local-6989586621679053291"><span class="hs-identifier hs-var hs-var hs-var hs-var">mask</span></a></span></span><span> </span><span id="local-6989586621679053290"><span class="annot"><span class="annottext">(forall a. ExceptT e m a -&gt; ExceptT e m a) -&gt; ExceptT e m b
</span><a href="#local-6989586621679053290"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e b) -&gt; ExceptT e m b
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ExceptT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-var">ExceptT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e b) -&gt; ExceptT e m b)
-&gt; m (Either e b) -&gt; ExceptT e m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (Either e b)) -&gt; m (Either e b)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (Either e b)) -&gt; m (Either e b))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (Either e b)) -&gt; m (Either e b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053289"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053289"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ExceptT e m b -&gt; m (Either e b)
forall e (m :: * -&gt; *) a. ExceptT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#runExceptT"><span class="hs-identifier hs-var">runExceptT</span></a></span><span> </span><span class="annot"><span class="annottext">(ExceptT e m b -&gt; m (Either e b))
-&gt; ExceptT e m b -&gt; m (Either e b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(forall a. ExceptT e m a -&gt; ExceptT e m a) -&gt; ExceptT e m b
</span><a href="#local-6989586621679053290"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(m (Either e a) -&gt; m (Either e a))
-&gt; ExceptT e m a -&gt; ExceptT e m a
forall (m :: * -&gt; *) e a.
(m (Either e a) -&gt; m (Either e a))
-&gt; ExceptT e m a -&gt; ExceptT e m a
</span><a href="#local-6989586621679053288"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; m (Either e a)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053289"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-686"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-687"></span><span>      </span><span id="local-6989586621679054615"><span id="local-6989586621679054616"><span id="local-6989586621679054617"><span class="annot"><a href="#local-6989586621679053288"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054617"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054616"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054615"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054617"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054616"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054615"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-688"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-type">ExceptT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054616"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054617"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054615"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-type">ExceptT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054616"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054617"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054615"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-689"></span><span>      </span><span id="local-6989586621679053288"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) e a.
(m (Either e a) -&gt; m (Either e a))
-&gt; ExceptT e m a -&gt; ExceptT e m a
</span><a href="#local-6989586621679053288"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053287"><span class="annot"><span class="annottext">m (Either e a) -&gt; m (Either e a)
</span><a href="#local-6989586621679053287"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-type">ExceptT</span></a></span><span> </span><span id="local-6989586621679053286"><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679053286"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ExceptT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ExceptT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-var">ExceptT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m (Either e a) -&gt; m (Either e a)
</span><a href="#local-6989586621679053287"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679053286"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-690"></span><span>  </span><span id="local-6989586621679053284"><span class="annot"><span class="annottext">uninterruptibleMask :: forall b.
((forall a. ExceptT e m a -&gt; ExceptT e m a) -&gt; ExceptT e m b)
-&gt; ExceptT e m b
</span><a href="#local-6989586621679053284"><span class="hs-identifier hs-var hs-var hs-var hs-var">uninterruptibleMask</span></a></span></span><span> </span><span id="local-6989586621679053283"><span class="annot"><span class="annottext">(forall a. ExceptT e m a -&gt; ExceptT e m a) -&gt; ExceptT e m b
</span><a href="#local-6989586621679053283"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e b) -&gt; ExceptT e m b
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ExceptT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-var">ExceptT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e b) -&gt; ExceptT e m b)
-&gt; m (Either e b) -&gt; ExceptT e m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m (Either e b)) -&gt; m (Either e b)
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-var">uninterruptibleMask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m (Either e b)) -&gt; m (Either e b))
-&gt; ((forall a. m a -&gt; m a) -&gt; m (Either e b)) -&gt; m (Either e b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053282"><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><a href="#local-6989586621679053282"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ExceptT e m b -&gt; m (Either e b)
forall e (m :: * -&gt; *) a. ExceptT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#runExceptT"><span class="hs-identifier hs-var">runExceptT</span></a></span><span> </span><span class="annot"><span class="annottext">(ExceptT e m b -&gt; m (Either e b))
-&gt; ExceptT e m b -&gt; m (Either e b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(forall a. ExceptT e m a -&gt; ExceptT e m a) -&gt; ExceptT e m b
</span><a href="#local-6989586621679053283"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(m (Either e a) -&gt; m (Either e a))
-&gt; ExceptT e m a -&gt; ExceptT e m a
forall (m :: * -&gt; *) e a.
(m (Either e a) -&gt; m (Either e a))
-&gt; ExceptT e m a -&gt; ExceptT e m a
</span><a href="#local-6989586621679053281"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; m (Either e a)
forall a. m a -&gt; m a
</span><a href="#local-6989586621679053282"><span class="hs-identifier hs-var">u</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-691"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-692"></span><span>      </span><span id="local-6989586621679053278"><span id="local-6989586621679053279"><span id="local-6989586621679053280"><span class="annot"><a href="#local-6989586621679053281"><span class="hs-identifier hs-type">q</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053280"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053279"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053278"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053280"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053279"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053278"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-693"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-type">ExceptT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053279"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053280"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053278"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-type">ExceptT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053279"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053280"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053278"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-694"></span><span>      </span><span id="local-6989586621679053281"><span class="annot"><span class="annottext">q :: forall (m :: * -&gt; *) e a.
(m (Either e a) -&gt; m (Either e a))
-&gt; ExceptT e m a -&gt; ExceptT e m a
</span><a href="#local-6989586621679053281"><span class="hs-identifier hs-var hs-var">q</span></a></span></span><span> </span><span id="local-6989586621679053277"><span class="annot"><span class="annottext">m (Either e a) -&gt; m (Either e a)
</span><a href="#local-6989586621679053277"><span class="hs-identifier hs-var">u</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-type">ExceptT</span></a></span><span> </span><span id="local-6989586621679053276"><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679053276"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ExceptT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ExceptT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-var">ExceptT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m (Either e a) -&gt; m (Either e a)
</span><a href="#local-6989586621679053277"><span class="hs-identifier hs-var">u</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679053276"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-695"></span><span>
</span><span id="line-696"></span><span>  </span><span id="local-6989586621679053267"><span class="annot"><span class="annottext">generalBracket :: forall a b c.
ExceptT e m a
-&gt; (a -&gt; ExitCase b -&gt; ExceptT e m c)
-&gt; (a -&gt; ExceptT e m b)
-&gt; ExceptT e m (b, c)
</span><a href="#local-6989586621679053267"><span class="hs-identifier hs-var hs-var hs-var hs-var">generalBracket</span></a></span></span><span> </span><span id="local-6989586621679053266"><span class="annot"><span class="annottext">ExceptT e m a
</span><a href="#local-6989586621679053266"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679053265"><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; ExceptT e m c
</span><a href="#local-6989586621679053265"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span id="local-6989586621679053264"><span class="annot"><span class="annottext">a -&gt; ExceptT e m b
</span><a href="#local-6989586621679053264"><span class="hs-identifier hs-var">use</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e (b, c)) -&gt; ExceptT e m (b, c)
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ExceptT e m a
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#ExceptT"><span class="hs-identifier hs-var">ExceptT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e (b, c)) -&gt; ExceptT e m (b, c))
-&gt; m (Either e (b, c)) -&gt; ExceptT e m (b, c)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-697"></span><span>    </span><span class="hs-comment">-- This implementation is given as an example in the documentation of</span><span>
</span><span id="line-698"></span><span>    </span><span class="hs-comment">-- 'generalBracket', so when changing it, remember to update the</span><span>
</span><span id="line-699"></span><span>    </span><span class="hs-comment">-- documentation's copy as well</span><span>
</span><span id="line-700"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679053263"><span class="annot"><span class="annottext">Either e b
</span><a href="#local-6989586621679053263"><span class="hs-identifier hs-var">eb</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679053262"><span class="annot"><span class="annottext">Either e c
</span><a href="#local-6989586621679053262"><span class="hs-identifier hs-var">ec</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (Either e a)
-&gt; (Either e a -&gt; ExitCase (Either e b) -&gt; m (Either e c))
-&gt; (Either e a -&gt; m (Either e b))
-&gt; m (Either e b, Either e c)
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-701"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExceptT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ExceptT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#runExceptT"><span class="hs-identifier hs-var">runExceptT</span></a></span><span> </span><span class="annot"><span class="annottext">ExceptT e m a
</span><a href="#local-6989586621679053266"><span class="hs-identifier hs-var">acquire</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-702"></span><span>      </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679053261"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679053261"><span class="hs-identifier hs-var">eresource</span></a></span></span><span> </span><span id="local-6989586621679053260"><span class="annot"><span class="annottext">ExitCase (Either e b)
</span><a href="#local-6989586621679053260"><span class="hs-identifier hs-var">exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679053261"><span class="hs-identifier hs-var">eresource</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-703"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679053259"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053259"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either e c -&gt; m (Either e c)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; Either e c
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053259"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- nothing to release, acquire didn't succeed</span><span>
</span><span id="line-704"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679053258"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053258"><span class="hs-identifier hs-var">resource</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ExitCase (Either e b)
</span><a href="#local-6989586621679053260"><span class="hs-identifier hs-var">exitCase</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-705"></span><span>          </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-type">ExitCaseSuccess</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679053257"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053257"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ExceptT e m c -&gt; m (Either e c)
forall e (m :: * -&gt; *) a. ExceptT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#runExceptT"><span class="hs-identifier hs-var">runExceptT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; ExceptT e m c
</span><a href="#local-6989586621679053265"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053258"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; ExitCase b
forall a. a -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-var">ExitCaseSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053257"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-706"></span><span>          </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-type">ExitCaseException</span></a></span><span> </span><span id="local-6989586621679053256"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053256"><span class="hs-identifier hs-var">e</span></a></span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ExceptT e m c -&gt; m (Either e c)
forall e (m :: * -&gt; *) a. ExceptT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#runExceptT"><span class="hs-identifier hs-var">runExceptT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; ExceptT e m c
</span><a href="#local-6989586621679053265"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053258"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; ExitCase b
forall a. SomeException -&gt; ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseException"><span class="hs-identifier hs-var">ExitCaseException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053256"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-707"></span><span>          </span><span class="annot"><span class="annottext">ExitCase (Either e b)
</span><span class="hs-identifier">_</span></span><span>                         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ExceptT e m c -&gt; m (Either e c)
forall e (m :: * -&gt; *) a. ExceptT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#runExceptT"><span class="hs-identifier hs-var">runExceptT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ExitCase b -&gt; ExceptT e m c
</span><a href="#local-6989586621679053265"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053258"><span class="hs-identifier hs-var">resource</span></a></span><span> </span><span class="annot"><span class="annottext">ExitCase b
forall a. ExitCase a
</span><a href="Control.Monad.Catch.html#ExitCaseAbort"><span class="hs-identifier hs-var">ExitCaseAbort</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-708"></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(e -&gt; m (Either e b))
-&gt; (a -&gt; m (Either e b)) -&gt; Either e a -&gt; m (Either e b)
forall a c b. (a -&gt; c) -&gt; (b -&gt; c) -&gt; Either a b -&gt; c
</span><a href="../../base/src/Data.Either.html#either"><span class="hs-identifier hs-var">either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Either e b -&gt; m (Either e b)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either e b -&gt; m (Either e b))
-&gt; (e -&gt; Either e b) -&gt; e -&gt; m (Either e b)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e b
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExceptT e m b -&gt; m (Either e b)
forall e (m :: * -&gt; *) a. ExceptT e m a -&gt; m (Either e a)
</span><a href="../../transformers/src/Control.Monad.Trans.Except.html#runExceptT"><span class="hs-identifier hs-var">runExceptT</span></a></span><span> </span><span class="annot"><span class="annottext">(ExceptT e m b -&gt; m (Either e b))
-&gt; (a -&gt; ExceptT e m b) -&gt; a -&gt; m (Either e b)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ExceptT e m b
</span><a href="#local-6989586621679053264"><span class="hs-identifier hs-var">use</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-709"></span><span>    </span><span class="annot"><span class="annottext">Either e (b, c) -&gt; m (Either e (b, c))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either e (b, c) -&gt; m (Either e (b, c)))
-&gt; Either e (b, c) -&gt; m (Either e (b, c))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-710"></span><span>      </span><span class="hs-comment">-- The order in which we perform those two 'Either' effects determines</span><span>
</span><span id="line-711"></span><span>      </span><span class="hs-comment">-- which error will win if they are both 'Left's. We want the error from</span><span>
</span><span id="line-712"></span><span>      </span><span class="hs-comment">-- 'release' to win.</span><span>
</span><span id="line-713"></span><span>      </span><span id="local-6989586621679053255"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053255"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Either e c
</span><a href="#local-6989586621679053262"><span class="hs-identifier hs-var">ec</span></a></span><span>
</span><span id="line-714"></span><span>      </span><span id="local-6989586621679053254"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053254"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Either e b
</span><a href="#local-6989586621679053263"><span class="hs-identifier hs-var">eb</span></a></span><span>
</span><span id="line-715"></span><span>      </span><span class="annot"><span class="annottext">(b, c) -&gt; Either e (b, c)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679053254"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679053255"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-716"></span><span>
</span><span id="line-717"></span><span id="local-6989586621679054596"><span id="local-6989586621679054597"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054597"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadThrow"><span class="hs-identifier hs-type">MonadThrow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../transformers/src/Control.Monad.Trans.Cont.html#ContT"><span class="hs-identifier hs-type">ContT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054596"><span class="hs-identifier hs-type">r</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054597"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-718"></span><span>  </span><span id="local-6989586621679053240"><span class="annot"><span class="annottext">throwM :: forall e a. Exception e =&gt; e -&gt; ContT r m a
</span><a href="#local-6989586621679053240"><span class="hs-identifier hs-var hs-var hs-var hs-var">throwM</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ContT r m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ContT r m a) -&gt; (e -&gt; m a) -&gt; e -&gt; ContT r m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span></span></span><span>
</span><span id="line-719"></span><span class="hs-comment">-- I don't believe any valid of MonadCatch exists for ContT.</span><span>
</span><span id="line-720"></span><span class="hs-comment">-- instance MonadCatch m =&gt; MonadCatch (ContT r m) where</span><span>
</span><span id="line-721"></span><span>
</span><span id="line-722"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-723"></span><span class="hs-comment">-- $utilities</span><span>
</span><span id="line-724"></span><span class="hs-comment">-- These functions follow those from &quot;Control.Exception&quot;, except that they are</span><span>
</span><span id="line-725"></span><span class="hs-comment">-- based on methods from the 'MonadCatch' typeclass. See</span><span>
</span><span id="line-726"></span><span class="hs-comment">-- &quot;Control.Exception&quot; for API usage.</span><span>
</span><span id="line-727"></span><span class="hs-comment">------------------------------------------------------------------------------</span><span>
</span><span id="line-728"></span><span>
</span><span id="line-729"></span><span class="hs-comment">-- | Like 'mask', but does not pass a @restore@ action to the argument.</span><span>
</span><span id="line-730"></span><span id="local-6989586621679054591"><span id="local-6989586621679054592"><span class="annot"><a href="Control.Monad.Catch.html#mask_"><span class="hs-identifier hs-type">mask_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054592"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054592"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054591"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054592"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054591"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-731"></span><span id="mask_"><span class="annot"><span class="annottext">mask_ :: forall (m :: * -&gt; *) a. MonadMask m =&gt; m a -&gt; m a
</span><a href="Control.Monad.Catch.html#mask_"><span class="hs-identifier hs-var hs-var">mask_</span></a></span></span><span> </span><span id="local-6989586621679053237"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053237"><span class="hs-identifier hs-var">io</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m a) -&gt; m a)
-&gt; ((forall a. m a -&gt; m a) -&gt; m a) -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053237"><span class="hs-identifier hs-var">io</span></a></span><span>
</span><span id="line-732"></span><span>
</span><span id="line-733"></span><span class="hs-comment">-- | Like 'uninterruptibleMask', but does not pass a @restore@ action to the</span><span>
</span><span id="line-734"></span><span class="hs-comment">-- argument.</span><span>
</span><span id="line-735"></span><span id="local-6989586621679053235"><span id="local-6989586621679053236"><span class="annot"><a href="Control.Monad.Catch.html#uninterruptibleMask_"><span class="hs-identifier hs-type">uninterruptibleMask_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053236"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053236"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053235"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053236"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053235"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-736"></span><span id="uninterruptibleMask_"><span class="annot"><span class="annottext">uninterruptibleMask_ :: forall (m :: * -&gt; *) a. MonadMask m =&gt; m a -&gt; m a
</span><a href="Control.Monad.Catch.html#uninterruptibleMask_"><span class="hs-identifier hs-var hs-var">uninterruptibleMask_</span></a></span></span><span> </span><span id="local-6989586621679053232"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053232"><span class="hs-identifier hs-var">io</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((forall a. m a -&gt; m a) -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) b.
MonadMask m =&gt;
((forall a. m a -&gt; m a) -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#uninterruptibleMask"><span class="hs-identifier hs-var">uninterruptibleMask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. m a -&gt; m a) -&gt; m a) -&gt; m a)
-&gt; ((forall a. m a -&gt; m a) -&gt; m a) -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">forall a. m a -&gt; m a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053232"><span class="hs-identifier hs-var">io</span></a></span><span>
</span><span id="line-737"></span><span>
</span><span id="line-738"></span><span class="hs-comment">-- | Catches all exceptions, and somewhat defeats the purpose of the extensible</span><span>
</span><span id="line-739"></span><span class="hs-comment">-- exception system. Use sparingly.</span><span>
</span><span id="line-740"></span><span class="hs-comment">--</span><span>
</span><span id="line-741"></span><span class="hs-comment">-- /NOTE/ This catches all /exceptions/, but if the monad supports other ways of</span><span>
</span><span id="line-742"></span><span class="hs-comment">-- aborting the computation, those other kinds of errors will not be caught.</span><span>
</span><span id="line-743"></span><span id="local-6989586621679054584"><span id="local-6989586621679054585"><span class="annot"><a href="Control.Monad.Catch.html#catchAll"><span class="hs-identifier hs-type">catchAll</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054585"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054585"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054584"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054585"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054584"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054585"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054584"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-744"></span><span id="catchAll"><span class="annot"><span class="annottext">catchAll :: forall (m :: * -&gt; *) a.
MonadCatch m =&gt;
m a -&gt; (SomeException -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catchAll"><span class="hs-identifier hs-var hs-var">catchAll</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; (SomeException -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span>
</span><span id="line-745"></span><span>
</span><span id="line-746"></span><span class="hs-comment">-- | Catch all 'IOError' (eqv. 'IOException') exceptions. Still somewhat too</span><span>
</span><span id="line-747"></span><span class="hs-comment">-- general, but better than using 'catchAll'. See 'catchIf' for an easy way</span><span>
</span><span id="line-748"></span><span class="hs-comment">-- of catching specific 'IOError's based on the predicates in &quot;System.IO.Error&quot;.</span><span>
</span><span id="line-749"></span><span id="local-6989586621679054580"><span id="local-6989586621679054581"><span class="annot"><a href="Control.Monad.Catch.html#catchIOError"><span class="hs-identifier hs-type">catchIOError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054581"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054581"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054580"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOError"><span class="hs-identifier hs-type">IOError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054581"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054580"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054581"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054580"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-750"></span><span id="catchIOError"><span class="annot"><span class="annottext">catchIOError :: forall (m :: * -&gt; *) a.
MonadCatch m =&gt;
m a -&gt; (IOError -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catchIOError"><span class="hs-identifier hs-var hs-var">catchIOError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; (IOError -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span>
</span><span id="line-751"></span><span>
</span><span id="line-752"></span><span class="hs-comment">-- | Catch exceptions only if they pass some predicate. Often useful with the</span><span>
</span><span id="line-753"></span><span class="hs-comment">-- predicates for testing 'IOError' values in &quot;System.IO.Error&quot;.</span><span>
</span><span id="line-754"></span><span id="local-6989586621679054574"><span id="local-6989586621679054575"><span id="local-6989586621679054576"><span class="annot"><a href="Control.Monad.Catch.html#catchIf"><span class="hs-identifier hs-type">catchIf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054576"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054575"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-755"></span><span>    </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054575"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054576"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054574"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054575"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054576"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054574"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054576"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054574"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-756"></span><span id="catchIf"><span class="annot"><span class="annottext">catchIf :: forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; Bool) -&gt; m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catchIf"><span class="hs-identifier hs-var hs-var">catchIf</span></a></span></span><span> </span><span id="local-6989586621679053217"><span class="annot"><span class="annottext">e -&gt; Bool
</span><a href="#local-6989586621679053217"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679053216"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053216"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679053215"><span class="annot"><span class="annottext">e -&gt; m a
</span><a href="#local-6989586621679053215"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053216"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (e -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-operator hs-var">`catch`</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053214"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053214"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">e -&gt; Bool
</span><a href="#local-6989586621679053217"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053214"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
</span><a href="#local-6989586621679053215"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053214"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053214"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-757"></span><span>
</span><span id="line-758"></span><span class="hs-comment">-- | A more generalized way of determining which exceptions to catch at</span><span>
</span><span id="line-759"></span><span class="hs-comment">-- run time.</span><span>
</span><span id="line-760"></span><span id="local-6989586621679054567"><span id="local-6989586621679054568"><span id="local-6989586621679054569"><span id="local-6989586621679054570"><span class="annot"><a href="Control.Monad.Catch.html#catchJust"><span class="hs-identifier hs-type">catchJust</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054570"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054569"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-761"></span><span>    </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054569"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054568"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054570"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054567"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054568"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054570"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054567"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054570"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054567"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-762"></span><span id="catchJust"><span class="annot"><span class="annottext">catchJust :: forall (m :: * -&gt; *) e b a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; Maybe b) -&gt; m a -&gt; (b -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catchJust"><span class="hs-identifier hs-var hs-var">catchJust</span></a></span></span><span> </span><span id="local-6989586621679053206"><span class="annot"><span class="annottext">e -&gt; Maybe b
</span><a href="#local-6989586621679053206"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679053205"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053205"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679053204"><span class="annot"><span class="annottext">b -&gt; m a
</span><a href="#local-6989586621679053204"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053205"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (e -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-operator hs-var">`catch`</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053203"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053203"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m a -&gt; (b -&gt; m a) -&gt; Maybe b -&gt; m a
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053203"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">b -&gt; m a
</span><a href="#local-6989586621679053204"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe b -&gt; m a) -&gt; Maybe b -&gt; m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; Maybe b
</span><a href="#local-6989586621679053206"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053203"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-763"></span><span>
</span><span id="line-764"></span><span class="hs-comment">-- | Flipped 'catch'. See &quot;Control.Exception&quot;'s 'ControlException.handle'.</span><span>
</span><span id="line-765"></span><span id="local-6989586621679054558"><span id="local-6989586621679054559"><span id="local-6989586621679054560"><span class="annot"><a href="Control.Monad.Catch.html#handle"><span class="hs-identifier hs-type">handle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054560"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054559"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054559"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054560"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054558"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054560"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054558"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054560"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054558"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-766"></span><span id="handle"><span class="annot"><span class="annottext">handle :: forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; m a) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Catch.html#handle"><span class="hs-identifier hs-var hs-var">handle</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m a -&gt; (e -&gt; m a) -&gt; m a) -&gt; (e -&gt; m a) -&gt; m a -&gt; m a
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (e -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span>
</span><span id="line-767"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#handle"><span class="hs-pragma hs-type">handle</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-768"></span><span>
</span><span id="line-769"></span><span class="hs-comment">-- | Flipped 'catchIOError'</span><span>
</span><span id="line-770"></span><span id="local-6989586621679054550"><span id="local-6989586621679054551"><span class="annot"><a href="Control.Monad.Catch.html#handleIOError"><span class="hs-identifier hs-type">handleIOError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054551"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOError"><span class="hs-identifier hs-type">IOError</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054551"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054550"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054551"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054550"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054551"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054550"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-771"></span><span id="handleIOError"><span class="annot"><span class="annottext">handleIOError :: forall (m :: * -&gt; *) a.
MonadCatch m =&gt;
(IOError -&gt; m a) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Catch.html#handleIOError"><span class="hs-identifier hs-var hs-var">handleIOError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(IOError -&gt; m a) -&gt; m a -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; m a) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Catch.html#handle"><span class="hs-identifier hs-var">handle</span></a></span><span>
</span><span id="line-772"></span><span>
</span><span id="line-773"></span><span class="hs-comment">-- | Flipped 'catchAll'</span><span>
</span><span id="line-774"></span><span id="local-6989586621679054546"><span id="local-6989586621679054547"><span class="annot"><a href="Control.Monad.Catch.html#handleAll"><span class="hs-identifier hs-type">handleAll</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054547"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054547"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054546"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054547"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054546"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054547"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054546"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-775"></span><span id="handleAll"><span class="annot"><span class="annottext">handleAll :: forall (m :: * -&gt; *) a.
MonadCatch m =&gt;
(SomeException -&gt; m a) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Catch.html#handleAll"><span class="hs-identifier hs-var hs-var">handleAll</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SomeException -&gt; m a) -&gt; m a -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; m a) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Catch.html#handle"><span class="hs-identifier hs-var">handle</span></a></span><span>
</span><span id="line-776"></span><span>
</span><span id="line-777"></span><span class="hs-comment">-- | Flipped 'catchIf'</span><span>
</span><span id="line-778"></span><span id="local-6989586621679054541"><span id="local-6989586621679054542"><span id="local-6989586621679054543"><span class="annot"><a href="Control.Monad.Catch.html#handleIf"><span class="hs-identifier hs-type">handleIf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054543"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054542"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054542"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054542"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054543"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054541"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054543"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054541"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054543"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054541"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-779"></span><span id="handleIf"><span class="annot"><span class="annottext">handleIf :: forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; Bool) -&gt; (e -&gt; m a) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Catch.html#handleIf"><span class="hs-identifier hs-var hs-var">handleIf</span></a></span></span><span> </span><span id="local-6989586621679053186"><span class="annot"><span class="annottext">e -&gt; Bool
</span><a href="#local-6989586621679053186"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m a -&gt; (e -&gt; m a) -&gt; m a) -&gt; (e -&gt; m a) -&gt; m a -&gt; m a
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(e -&gt; Bool) -&gt; m a -&gt; (e -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; Bool) -&gt; m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catchIf"><span class="hs-identifier hs-var">catchIf</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; Bool
</span><a href="#local-6989586621679053186"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-780"></span><span>
</span><span id="line-781"></span><span class="hs-comment">-- | Flipped 'catchJust'. See &quot;Control.Exception&quot;'s 'ControlException.handleJust'.</span><span>
</span><span id="line-782"></span><span id="local-6989586621679054534"><span id="local-6989586621679054535"><span id="local-6989586621679054536"><span id="local-6989586621679054537"><span class="annot"><a href="Control.Monad.Catch.html#handleJust"><span class="hs-identifier hs-type">handleJust</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054537"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054536"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054536"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054535"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054535"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054537"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054534"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054537"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054534"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054537"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054534"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-783"></span><span id="handleJust"><span class="annot"><span class="annottext">handleJust :: forall (m :: * -&gt; *) e b a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; Maybe b) -&gt; (b -&gt; m a) -&gt; m a -&gt; m a
</span><a href="Control.Monad.Catch.html#handleJust"><span class="hs-identifier hs-var hs-var">handleJust</span></a></span></span><span> </span><span id="local-6989586621679053181"><span class="annot"><span class="annottext">e -&gt; Maybe b
</span><a href="#local-6989586621679053181"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m a -&gt; (b -&gt; m a) -&gt; m a) -&gt; (b -&gt; m a) -&gt; m a -&gt; m a
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(e -&gt; Maybe b) -&gt; m a -&gt; (b -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) e b a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; Maybe b) -&gt; m a -&gt; (b -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catchJust"><span class="hs-identifier hs-var">catchJust</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; Maybe b
</span><a href="#local-6989586621679053181"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-784"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#handleJust"><span class="hs-pragma hs-type">handleJust</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-785"></span><span>
</span><span id="line-786"></span><span class="hs-comment">-- | Similar to 'catch', but returns an 'Either' result. See &quot;Control.Exception&quot;'s</span><span>
</span><span id="line-787"></span><span class="hs-comment">-- 'Control.Exception.try'.</span><span>
</span><span id="line-788"></span><span id="local-6989586621679054527"><span id="local-6989586621679054528"><span id="local-6989586621679054529"><span class="annot"><a href="Control.Monad.Catch.html#try"><span class="hs-identifier hs-type">try</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054529"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054528"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054529"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054527"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054529"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054528"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054527"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-789"></span><span id="try"><span class="annot"><span class="annottext">try :: forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; m (Either e a)
</span><a href="Control.Monad.Catch.html#try"><span class="hs-identifier hs-var hs-var">try</span></a></span></span><span> </span><span id="local-6989586621679053172"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053172"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; (e -&gt; m (Either e a)) -&gt; m (Either e a)
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Either e a
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; Either e a) -&gt; m a -&gt; m (Either e a)
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-operator hs-var">`liftM`</span></a></span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053172"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Either e a -&gt; m (Either e a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either e a -&gt; m (Either e a))
-&gt; (e -&gt; Either e a) -&gt; e -&gt; m (Either e a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-790"></span><span>
</span><span id="line-791"></span><span class="hs-comment">-- | A variant of 'try' that takes an exception predicate to select</span><span>
</span><span id="line-792"></span><span class="hs-comment">-- which exceptions are caught. See &quot;Control.Exception&quot;'s 'ControlException.tryJust'</span><span>
</span><span id="line-793"></span><span id="local-6989586621679054517"><span id="local-6989586621679054518"><span id="local-6989586621679054519"><span id="local-6989586621679054520"><span class="annot"><a href="Control.Monad.Catch.html#tryJust"><span class="hs-identifier hs-type">tryJust</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054520"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054519"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-794"></span><span>    </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054519"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054518"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054520"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054517"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054520"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054518"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054517"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span></span><span>
</span><span id="line-795"></span><span id="tryJust"><span class="annot"><span class="annottext">tryJust :: forall (m :: * -&gt; *) e b a.
(MonadCatch m, Exception e) =&gt;
(e -&gt; Maybe b) -&gt; m a -&gt; m (Either b a)
</span><a href="Control.Monad.Catch.html#tryJust"><span class="hs-identifier hs-var hs-var">tryJust</span></a></span></span><span> </span><span id="local-6989586621679053160"><span class="annot"><span class="annottext">e -&gt; Maybe b
</span><a href="#local-6989586621679053160"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679053159"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053159"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either b a) -&gt; (e -&gt; m (Either b a)) -&gt; m (Either b a)
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Either b a
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; Either b a) -&gt; m a -&gt; m (Either b a)
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-operator hs-var">`liftM`</span></a></span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053159"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679053158"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053158"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m (Either b a)
-&gt; (b -&gt; m (Either b a)) -&gt; Maybe b -&gt; m (Either b a)
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; m (Either b a)
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053158"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Either b a -&gt; m (Either b a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either b a -&gt; m (Either b a))
-&gt; (b -&gt; Either b a) -&gt; b -&gt; m (Either b a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; Either b a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; Maybe b
</span><a href="#local-6989586621679053160"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679053158"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-796"></span><span>
</span><span id="line-797"></span><span class="hs-comment">-- | Generalized version of 'ControlException.Handler'</span><span>
</span><span id="line-798"></span><span class="hs-keyword">data</span><span> </span><span id="Handler"><span class="annot"><a href="Control.Monad.Catch.html#Handler"><span class="hs-identifier hs-var">Handler</span></a></span></span><span> </span><span id="local-6989586621679054502"><span class="annot"><a href="#local-6989586621679054502"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679054501"><span class="annot"><a href="#local-6989586621679054501"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679054503"><span class="annot"><a href="#local-6989586621679054503"><span class="hs-identifier hs-type">e</span></a></span></span><span> </span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="../../base/src/GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">ControlException.Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054503"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="Handler"><span class="annot"><a href="Control.Monad.Catch.html#Handler"><span class="hs-identifier hs-var">Handler</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054503"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054502"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054501"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-799"></span><span>
</span><span id="line-800"></span><span id="local-6989586621679054507"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679053154"><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054507"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#Handler"><span class="hs-identifier hs-type">Handler</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054507"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-801"></span><span>  </span><span id="local-6989586621679053152"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; Handler m a -&gt; Handler m b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679053151"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679053151"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#Handler"><span class="hs-identifier hs-type">Handler</span></a></span><span> </span><span id="local-6989586621679053147"><span class="annot"><span class="annottext">e -&gt; m a
</span><a href="#local-6989586621679053147"><span class="hs-identifier hs-var">h</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(e -&gt; m b) -&gt; Handler m b
forall (m :: * -&gt; *) a e. Exception e =&gt; (e -&gt; m a) -&gt; Handler m a
</span><a href="Control.Monad.Catch.html#Handler"><span class="hs-identifier hs-var">Handler</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; m a -&gt; m b
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679053151"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; m b) -&gt; (e -&gt; m a) -&gt; e -&gt; m b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
</span><a href="#local-6989586621679053147"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-802"></span><span>
</span><span id="line-803"></span><span class="hs-comment">-- | Catches different sorts of exceptions. See &quot;Control.Exception&quot;'s 'ControlException.catches'</span><span>
</span><span id="line-804"></span><span id="local-6989586621679054498"><span id="local-6989586621679054499"><span id="local-6989586621679054500"><span class="annot"><a href="Control.Monad.Catch.html#catches"><span class="hs-identifier hs-type">catches</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054500"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054499"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054499"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054498"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054500"><span class="hs-identifier hs-type">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#Handler"><span class="hs-identifier hs-type">Handler</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054499"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054498"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054499"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054498"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-805"></span><span id="catches"><span class="annot"><span class="annottext">catches :: forall (f :: * -&gt; *) (m :: * -&gt; *) a.
(Foldable f, MonadCatch m) =&gt;
m a -&gt; f (Handler m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catches"><span class="hs-identifier hs-var hs-var">catches</span></a></span></span><span> </span><span id="local-6989586621679053138"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053138"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679053137"><span class="annot"><span class="annottext">f (Handler m a)
</span><a href="#local-6989586621679053137"><span class="hs-identifier hs-var">hs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053138"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (SomeException -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) e a.
(MonadCatch m, Exception e) =&gt;
m a -&gt; (e -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catch"><span class="hs-operator hs-var">`catch`</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; m a
</span><a href="#local-6989586621679053136"><span class="hs-identifier hs-var">handler</span></a></span><span>
</span><span id="line-806"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-807"></span><span>    </span><span id="local-6989586621679053136"><span class="annot"><span class="annottext">handler :: SomeException -&gt; m a
</span><a href="#local-6989586621679053136"><span class="hs-identifier hs-var hs-var">handler</span></a></span></span><span> </span><span id="local-6989586621679053135"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053135"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Handler m a -&gt; m a -&gt; m a) -&gt; m a -&gt; f (Handler m a) -&gt; m a
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Handler m a -&gt; m a -&gt; m a
</span><a href="#local-6989586621679053133"><span class="hs-identifier hs-var">probe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053135"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">f (Handler m a)
</span><a href="#local-6989586621679053137"><span class="hs-identifier hs-var">hs</span></a></span><span>
</span><span id="line-808"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-809"></span><span>        </span><span id="local-6989586621679053133"><span class="annot"><span class="annottext">probe :: Handler m a -&gt; m a -&gt; m a
</span><a href="#local-6989586621679053133"><span class="hs-identifier hs-var hs-var">probe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Catch.html#Handler"><span class="hs-identifier hs-type">Handler</span></a></span><span> </span><span id="local-6989586621679053130"><span class="annot"><span class="annottext">e -&gt; m a
</span><a href="#local-6989586621679053130"><span class="hs-identifier hs-var">h</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679053129"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053129"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; (e -&gt; m a) -&gt; Maybe e -&gt; m a
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053129"><span class="hs-identifier hs-var">xs</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; m a
</span><a href="#local-6989586621679053130"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException -&gt; Maybe e
forall e. Exception e =&gt; SomeException -&gt; Maybe e
</span><a href="../../base/src/GHC.Exception.Type.html#fromException"><span class="hs-identifier hs-var">ControlException.fromException</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053135"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-810"></span><span>
</span><span id="line-811"></span><span class="hs-comment">-- | Run an action only if an exception is thrown in the main action. The</span><span>
</span><span id="line-812"></span><span class="hs-comment">-- exception is not caught, simply rethrown.</span><span>
</span><span id="line-813"></span><span class="hs-comment">--</span><span>
</span><span id="line-814"></span><span class="hs-comment">-- /NOTE/ The action is only run if an /exception/ is thrown. If the monad</span><span>
</span><span id="line-815"></span><span class="hs-comment">-- supports other ways of aborting the computation, the action won't run if</span><span>
</span><span id="line-816"></span><span class="hs-comment">-- those other kinds of errors are thrown. See 'onError'.</span><span>
</span><span id="line-817"></span><span id="local-6989586621679054488"><span id="local-6989586621679054489"><span id="local-6989586621679054490"><span class="annot"><a href="Control.Monad.Catch.html#onException"><span class="hs-identifier hs-type">onException</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadCatch"><span class="hs-identifier hs-type">MonadCatch</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054490"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054490"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054489"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054490"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054488"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054490"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054489"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-818"></span><span id="onException"><span class="annot"><span class="annottext">onException :: forall (m :: * -&gt; *) a b. MonadCatch m =&gt; m a -&gt; m b -&gt; m a
</span><a href="Control.Monad.Catch.html#onException"><span class="hs-identifier hs-var hs-var">onException</span></a></span></span><span> </span><span id="local-6989586621679053121"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053121"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span id="local-6989586621679053120"><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679053120"><span class="hs-identifier hs-var">handler</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053121"><span class="hs-identifier hs-var">action</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (SomeException -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) a.
MonadCatch m =&gt;
m a -&gt; (SomeException -&gt; m a) -&gt; m a
</span><a href="Control.Monad.Catch.html#catchAll"><span class="hs-operator hs-var">`catchAll`</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679053119"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053119"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679053120"><span class="hs-identifier hs-var">handler</span></a></span><span> </span><span class="annot"><span class="annottext">m b -&gt; m a -&gt; m a
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException -&gt; m a
forall (m :: * -&gt; *) e a. (MonadThrow m, Exception e) =&gt; e -&gt; m a
</span><a href="Control.Monad.Catch.html#throwM"><span class="hs-identifier hs-var">throwM</span></a></span><span> </span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679053119"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-819"></span><span>
</span><span id="line-820"></span><span class="hs-comment">-- | Run an action only if an error is thrown in the main action. Unlike</span><span>
</span><span id="line-821"></span><span class="hs-comment">-- 'onException', this works with every kind of error, not just exceptions. For</span><span>
</span><span id="line-822"></span><span class="hs-comment">-- example, if @f@ is an 'ExceptT' computation which aborts with a 'Left', the</span><span>
</span><span id="line-823"></span><span class="hs-comment">-- computation @onError f g@ will execute @g@, while @onException f g@ will not.</span><span>
</span><span id="line-824"></span><span class="hs-comment">--</span><span>
</span><span id="line-825"></span><span class="hs-comment">-- This distinction is only meaningful for monads which have multiple exit</span><span>
</span><span id="line-826"></span><span class="hs-comment">-- points, such as 'Except' and 'MaybeT'. For monads that only have a single</span><span>
</span><span id="line-827"></span><span class="hs-comment">-- exit point, there is no difference between 'onException' and 'onError',</span><span>
</span><span id="line-828"></span><span class="hs-comment">-- except that 'onError' has a more constrained type.</span><span>
</span><span id="line-829"></span><span class="hs-comment">--</span><span>
</span><span id="line-830"></span><span class="hs-comment">-- @since 0.10.0</span><span>
</span><span id="line-831"></span><span id="local-6989586621679054482"><span id="local-6989586621679054483"><span id="local-6989586621679054484"><span class="annot"><a href="Control.Monad.Catch.html#onError"><span class="hs-identifier hs-type">onError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054484"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054484"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054483"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054484"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054482"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054484"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054483"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-832"></span><span id="onError"><span class="annot"><span class="annottext">onError :: forall (m :: * -&gt; *) a b. MonadMask m =&gt; m a -&gt; m b -&gt; m a
</span><a href="Control.Monad.Catch.html#onError"><span class="hs-identifier hs-var hs-var">onError</span></a></span></span><span> </span><span id="local-6989586621679053112"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053112"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span id="local-6989586621679053111"><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679053111"><span class="hs-identifier hs-var">handler</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m () -&gt; (() -&gt; m b) -&gt; (() -&gt; m a) -&gt; m a
forall (m :: * -&gt; *) a c b.
MonadMask m =&gt;
m a -&gt; (a -&gt; m c) -&gt; (a -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#bracketOnError"><span class="hs-identifier hs-var">bracketOnError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m b -&gt; () -&gt; m b
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679053111"><span class="hs-identifier hs-var">handler</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m a -&gt; () -&gt; m a
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053112"><span class="hs-identifier hs-var">action</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-833"></span><span>
</span><span id="line-834"></span><span class="hs-comment">-- | Generalized abstracted pattern of safe resource acquisition and release</span><span>
</span><span id="line-835"></span><span class="hs-comment">-- in the face of errors. The first action \&quot;acquires\&quot; some value, which</span><span>
</span><span id="line-836"></span><span class="hs-comment">-- is \&quot;released\&quot; by the second action at the end. The third action \&quot;uses\&quot;</span><span>
</span><span id="line-837"></span><span class="hs-comment">-- the value and its result is the result of the 'bracket'.</span><span>
</span><span id="line-838"></span><span class="hs-comment">--</span><span>
</span><span id="line-839"></span><span class="hs-comment">-- If an error is thrown during the use, the release still happens before the</span><span>
</span><span id="line-840"></span><span class="hs-comment">-- error is rethrown.</span><span>
</span><span id="line-841"></span><span class="hs-comment">--</span><span>
</span><span id="line-842"></span><span class="hs-comment">-- Note that this is essentially a type-specialized version of</span><span>
</span><span id="line-843"></span><span class="hs-comment">-- 'generalBracket'. This function has a more common signature (matching the</span><span>
</span><span id="line-844"></span><span class="hs-comment">-- signature from &quot;Control.Exception&quot;), and is often more convenient to use. By</span><span>
</span><span id="line-845"></span><span class="hs-comment">-- contrast, 'generalBracket' is more expressive, allowing us to implement</span><span>
</span><span id="line-846"></span><span class="hs-comment">-- other functions like 'bracketOnError'.</span><span>
</span><span id="line-847"></span><span id="local-6989586621679053106"><span id="local-6989586621679053107"><span id="local-6989586621679053108"><span id="local-6989586621679053109"><span class="annot"><a href="Control.Monad.Catch.html#bracket"><span class="hs-identifier hs-type">bracket</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053109"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053109"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053108"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053108"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053109"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053107"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679053108"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053109"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053106"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053109"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053106"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span><span>
</span><span id="line-848"></span><span id="bracket"><span class="annot"><span class="annottext">bracket :: forall (m :: * -&gt; *) a c b.
MonadMask m =&gt;
m a -&gt; (a -&gt; m c) -&gt; (a -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#bracket"><span class="hs-identifier hs-var hs-var">bracket</span></a></span></span><span> </span><span id="local-6989586621679053099"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053099"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679053098"><span class="annot"><span class="annottext">a -&gt; m c
</span><a href="#local-6989586621679053098"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((b, c) -&gt; b) -&gt; m (b, c) -&gt; m b
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">(b, c) -&gt; b
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">(m (b, c) -&gt; m b) -&gt; ((a -&gt; m b) -&gt; m (b, c)) -&gt; (a -&gt; m b) -&gt; m b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-849"></span><span>  </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053099"><span class="hs-identifier hs-var">acquire</span></a></span><span>
</span><span id="line-850"></span><span>  </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679053097"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053097"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679053096"><span class="annot"><span class="annottext">ExitCase b
</span><a href="#local-6989586621679053096"><span class="hs-identifier hs-var">_exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a -&gt; m c
</span><a href="#local-6989586621679053098"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053097"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-851"></span><span>
</span><span id="line-852"></span><span class="hs-comment">-- | Version of 'bracket' without any value being passed to the second and</span><span>
</span><span id="line-853"></span><span class="hs-comment">-- third actions.</span><span>
</span><span id="line-854"></span><span id="local-6989586621679054463"><span id="local-6989586621679054464"><span id="local-6989586621679054465"><span id="local-6989586621679054466"><span class="annot"><a href="Control.Monad.Catch.html#bracket_"><span class="hs-identifier hs-type">bracket_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054466"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054466"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054465"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054466"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054464"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054466"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054463"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054466"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054463"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span><span>
</span><span id="line-855"></span><span id="bracket_"><span class="annot"><span class="annottext">bracket_ :: forall (m :: * -&gt; *) a c b. MonadMask m =&gt; m a -&gt; m c -&gt; m b -&gt; m b
</span><a href="Control.Monad.Catch.html#bracket_"><span class="hs-identifier hs-var hs-var">bracket_</span></a></span></span><span> </span><span id="local-6989586621679053093"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053093"><span class="hs-identifier hs-var">before</span></a></span></span><span> </span><span id="local-6989586621679053092"><span class="annot"><span class="annottext">m c
</span><a href="#local-6989586621679053092"><span class="hs-identifier hs-var">after</span></a></span></span><span> </span><span id="local-6989586621679053091"><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679053091"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; (a -&gt; m c) -&gt; (a -&gt; m b) -&gt; m b
forall (m :: * -&gt; *) a c b.
MonadMask m =&gt;
m a -&gt; (a -&gt; m c) -&gt; (a -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#bracket"><span class="hs-identifier hs-var">bracket</span></a></span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053093"><span class="hs-identifier hs-var">before</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m c -&gt; a -&gt; m c
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">m c
</span><a href="#local-6989586621679053092"><span class="hs-identifier hs-var">after</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m b -&gt; a -&gt; m b
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679053091"><span class="hs-identifier hs-var">action</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-856"></span><span>
</span><span id="line-857"></span><span class="hs-comment">-- | Perform an action with a finalizer action that is run, even if an</span><span>
</span><span id="line-858"></span><span class="hs-comment">-- error occurs.</span><span>
</span><span id="line-859"></span><span id="local-6989586621679053088"><span id="local-6989586621679053089"><span id="local-6989586621679053090"><span class="annot"><a href="Control.Monad.Catch.html#finally"><span class="hs-identifier hs-type">finally</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053090"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053090"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053089"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053090"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053088"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679053090"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679053089"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-860"></span><span id="finally"><span class="annot"><span class="annottext">finally :: forall (m :: * -&gt; *) a b. MonadMask m =&gt; m a -&gt; m b -&gt; m a
</span><a href="Control.Monad.Catch.html#finally"><span class="hs-identifier hs-var hs-var">finally</span></a></span></span><span> </span><span id="local-6989586621679053081"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053081"><span class="hs-identifier hs-var">action</span></a></span></span><span> </span><span id="local-6989586621679053080"><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679053080"><span class="hs-identifier hs-var">finalizer</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m () -&gt; m b -&gt; m a -&gt; m a
forall (m :: * -&gt; *) a c b. MonadMask m =&gt; m a -&gt; m c -&gt; m b -&gt; m b
</span><a href="Control.Monad.Catch.html#bracket_"><span class="hs-identifier hs-var">bracket_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679053080"><span class="hs-identifier hs-var">finalizer</span></a></span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053081"><span class="hs-identifier hs-var">action</span></a></span><span>
</span><span id="line-861"></span><span>
</span><span id="line-862"></span><span class="hs-comment">-- | Like 'bracket', but only performs the final action if an error is</span><span>
</span><span id="line-863"></span><span class="hs-comment">-- thrown by the in-between computation.</span><span>
</span><span id="line-864"></span><span id="local-6989586621679054475"><span id="local-6989586621679054476"><span id="local-6989586621679054477"><span id="local-6989586621679054478"><span class="annot"><a href="Control.Monad.Catch.html#bracketOnError"><span class="hs-identifier hs-type">bracketOnError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Catch.html#MonadMask"><span class="hs-identifier hs-type">MonadMask</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054478"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054478"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054477"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054477"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054478"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054476"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679054477"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054478"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054475"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679054478"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679054475"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span><span>
</span><span id="line-865"></span><span id="bracketOnError"><span class="annot"><span class="annottext">bracketOnError :: forall (m :: * -&gt; *) a c b.
MonadMask m =&gt;
m a -&gt; (a -&gt; m c) -&gt; (a -&gt; m b) -&gt; m b
</span><a href="Control.Monad.Catch.html#bracketOnError"><span class="hs-identifier hs-var hs-var">bracketOnError</span></a></span></span><span> </span><span id="local-6989586621679053070"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053070"><span class="hs-identifier hs-var">acquire</span></a></span></span><span> </span><span id="local-6989586621679053069"><span class="annot"><span class="annottext">a -&gt; m c
</span><a href="#local-6989586621679053069"><span class="hs-identifier hs-var">release</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((b, ()) -&gt; b) -&gt; m (b, ()) -&gt; m b
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">(b, ()) -&gt; b
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">(m (b, ()) -&gt; m b)
-&gt; ((a -&gt; m b) -&gt; m (b, ())) -&gt; (a -&gt; m b) -&gt; m b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">m a -&gt; (a -&gt; ExitCase b -&gt; m ()) -&gt; (a -&gt; m b) -&gt; m (b, ())
forall (m :: * -&gt; *) a b c.
MonadMask m =&gt;
m a -&gt; (a -&gt; ExitCase b -&gt; m c) -&gt; (a -&gt; m b) -&gt; m (b, c)
</span><a href="Control.Monad.Catch.html#generalBracket"><span class="hs-identifier hs-var">generalBracket</span></a></span><span>
</span><span id="line-866"></span><span>  </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679053070"><span class="hs-identifier hs-var">acquire</span></a></span><span>
</span><span id="line-867"></span><span>  </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679053068"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053068"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679053067"><span class="annot"><span class="annottext">ExitCase b
</span><a href="#local-6989586621679053067"><span class="hs-identifier hs-var">exitCase</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ExitCase b
</span><a href="#local-6989586621679053067"><span class="hs-identifier hs-var">exitCase</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-868"></span><span>    </span><span class="annot"><a href="Control.Monad.Catch.html#ExitCaseSuccess"><span class="hs-identifier hs-type">ExitCaseSuccess</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-869"></span><span>    </span><span class="annot"><span class="annottext">ExitCase b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-870"></span><span>      </span><span class="annot"><span class="annottext">c
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; m c
</span><a href="#local-6989586621679053069"><span class="hs-identifier hs-var">release</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679053068"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-871"></span><span>      </span><span class="annot"><span class="annottext">() -&gt; m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-872"></span></pre></body></html>